parse-type
Simplifies to build parse types based on the parse module
What it is and what it does
parse_type is a library that builds on top of the parse module (which reverses string.format()) to add structured type conversion for common parsing patterns. It lets you define type converters for enumerations, optional fields, repeated elements, and choice lists, then use them in parse format strings with a cardinality-field naming convention (e.g., {item:Type?} for optional, {items:Type*} for zero-or-more, {items:Type+} for one-or-more).
The package depends on parse, enum34 (for Python 2.7 and early Python 3 compatibility), and six for cross-version compatibility. It's useful when you need to parse structured text into typed values—command-line arguments, configuration files, or domain-specific languages—without writing custom parsing logic for each type variant.
Use it for:
- Parse command-line arguments with optional flags and repeated values using a single schema.
- Convert configuration file entries into typed enums or choice values with cardinality constraints.
- Build domain-specific language parsers that accept multiple type alternatives (variants) in a single field.
- Parse log or data files where some fields are optional and others repeat, using declarative type definitions.
- Create structured text-to-object converters for testing frameworks or behavior-driven development tools.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends the parse module with type converters that handle enumerations, choices, cardinality constraints (optional, many, many-or-more), and variant types for structured text parsing.
Yes, if you are already using the parse module and need to handle enumerations, optional fields, or repeated elements without writing custom type converters. The low install friction and MIT license make it a low-risk addition. However, note the aging maintenance status (368 days since last release)—verify compatibility with your current parse module version and Python release before adopting in new projects.
Install
parse-type on PyPI
pip
pip install parse-typeuv
uv add parse-typepoetry
poetry add parse-typeInstalling parse-type
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 368 days ago—but the repository remains active and unarchived with modest community engagement (21 stars).
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects.
Quickstart
pip install parse-type
from parse import Parser
from parse_type import TypeBuilder
parse_enum = TypeBuilder.make_enum({"yes": True, "no": False})
parser = Parser("Answer: {answer:YesNo}", dict(YesNo=parse_enum))
result = parser.parse("Answer: yes")
assert result["answer"] == True
Verify before relying
- Whether the aging maintenance status (368 days since last release) affects compatibility with recent Python or parse module versions.
- Performance characteristics when handling large cardinality lists or deeply nested variant types.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (!=3.0.*,!=3.1.*,>=2.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — parse, enum34, six |
| Maintenance | aging — 368 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,574,100/month — #1,523 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: parse_type-0.6.6-py2.py3-none-any.whl
Keywords: parse, parsing
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
number-parserConverts numbers written in natural language…
permissive · top 15,000 on PyPI
django-choices-fieldProvides Django model fields that store and…
permissive · top 15,000 on PyPI
enum-compatConditionally installs enum34 on Python…
permissive · top 5,000 on PyPI
django-enumProvides a Django model field type that stores…
permissive · top 15,000 on PyPI
enum34Provides enumeration support for older Python…
permissive · top 5,000 on PyPI
types-enum34Provides type stubs for the enum34 package,…
permissive · top 15,000 on PyPI
marshmallow-enumProvides an Enum field type for Marshmallow…
permissive · top 5,000 on PyPI
cpeParses, compares, and evaluates Common Platform…
copyleft · top 15,000 on PyPI
stringparserExtracts values from strings using…
permissive · top 15,000 on PyPI
backports.strenumProvides StrEnum, a string-based enumeration…
permissive · top 5,000 on PyPI