skillfed

parse-type

Simplifies to build parse types based on the parse module

parse-type v0.6.6 9.6M downloads/30d#1,523 on PyPI21
Permissive license MIT AGING released

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-type

uv

uv add parse-type

poetry

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 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: Libraries :: Python Modules

Tags

parse type convertersenum parsing from textcardinality constraints parsingoptional and list parsingchoice and variant typesparse module extensionstext to type conversion
text-parsingtype-conversion

More Python Modules packages