parse
parse() is the opposite of format()
Decision gist · record as of 2026-08-14
Yes. Parse is lightweight, dependency-free, actively maintained, MIT-licensed, and solves a real problem—extracting data from formatted strings is more readable with parse() than with regex for many common cases. No known vulnerabilities. Install it if you need to reverse format() operations or prefer format-string patterns over regex for text extraction.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installs cleanly with no runtime dependencies and maintains active status with recent releases.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
last release 2026-05-26 (80 days) · last repo commit 2026-08-01 · 1,790 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 18,038,649 downloads/mo, #1,088 on PyPI
Alternatives
Verify before relying
from parse import parse, compile
# Simple extraction
result = parse("It's {}, I love it!", "It's spam, I love it!")
print(result[0]) # 'spam'
# Typed extraction
result = parse('Age: {:d}', 'Age: 42')
print(result[0]) # 42
# Compiled pattern for reuse
p = compile("The {} who {}")
result = p.parse("The knights who say Ni!")
print(result.fixed) # ('knights', 'say')- Whether the package supports Python 2 despite the wheel name suggesting it (parse-1.22.1-py2.py3-none-any.whl vs requires_python unspecified)
What it is and what it does
Parse is a string-parsing library that inverts Python's format() function: instead of inserting values into a template, it extracts values from a formatted string using the same template syntax. You define a pattern with placeholders like `{}` or named fields like `{name}`, and parse() returns the matched values as a Result object with both positional and named access.
The library supports format specifications for type conversion (integers, floats, dates, hex, binary, and regex character classes), alignment and width handling, and both case-sensitive and case-insensitive matching. It has no external dependencies and is lightweight enough for embedded use in data extraction pipelines, log parsing, or configuration file parsing.
Use it for
- Extract fields from log lines or structured text output without regex
- Parse configuration files or reports with consistent formatting
- Convert formatted strings back to typed Python objects (dates, numbers, etc.)
- Build data extraction pipelines where format patterns are more readable than regex
- Match and capture groups from text using Python's familiar format syntax
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Parse is lightweight, dependency-free, actively maintained, MIT-licensed, and solves a real problem—extracting data from formatted strings is more readable with parse() than with regex for many common cases. No known vulnerabilities. Install it if you need to reverse format() operations or prefer format-string patterns over regex for text extraction.
Install
parse on PyPI
Before you install
Installs cleanly with no runtime dependencies and maintains active status with recent releases.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Quickstart
from parse import parse, compile
# Simple extraction
result = parse("It's {}, I love it!", "It's spam, I love it!")
print(result[0]) # 'spam'
# Typed extraction
result = parse('Age: {:d}', 'Age: 42')
print(result[0]) # 42
# Compiled pattern for reuse
p = compile("The {} who {}")
result = p.parse("The knights who say Ni!")
print(result.fixed) # ('knights', 'say')
Verify before relying
- Whether the package supports Python 2 despite the wheel name suggesting it (parse-1.22.1-py2.py3-none-any.whl vs requires_python unspecified)
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 80 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 18,038,649 / month, #1,088 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentIntended Audience :: DevelopersProgramming Language :: Python :: 3Topic :: Software Development :: Code GeneratorsTopic :: Software Development :: Libraries :: Python Modules |
Evidence: parse-1.22.1-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “string parsing with format patterns”
- parseParse strings using format-string-like patterns to extract structured…
- stringparserExtracts values from strings using format-string patterns instead of…
- nr-dateA pure-Python date parser using regex patterns to extract and parse…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also dateformat · FixedWidth · iso8601 · isoduration · aniso8601 · ctparse · isodate · metomi-isodatetime · datefinder · price-parser