--- id: parse-type version: "0.6.6" license: MIT license_treatment: permissive maintenance: aging --- # parse-type — Simplifies to build parse types based on the parse module License: permissive · Maintenance: aging · Downloads: 9.6M/mo ## 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 above — 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 pip install parse-type uv add parse-type poetry add parse-type ## Installing 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_current - Install friction: low - Maintenance: aging - Downloads: 9.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags parse type converters, enum parsing from text, cardinality constraints parsing, optional and list parsing, choice and variant types, parse module extensions, text to type conversion, text-parsing, type-conversion [View on SkillFed](https://skillfed.io/packages/parse-type) · [View on PyPI](https://pypi.org/project/parse-type/)