flexparser
Parsing made fun ... using typing.
Decision gist · record as of 2026-08-14
Yes, if you need a lightweight, type-safe parser for line-oriented text and don't require active maintenance. The low dependency footprint and permissive license make it a reasonable choice for small-to-medium parsing tasks. The dormant status means no new features or bug fixes are likely, so evaluate whether the current API and behavior meet your needs before committing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only typing-extensions as a runtime dependency.
- Maintenance is dormant—last release was 2024-11-07 and last commit 2024-11-09, with no recent activity; the package is stable but not actively developed.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive and imposes no significant restrictions on use or redistribution, making it suitable for most commercial and open-source projects.
last release 2024-11-07 (645 days) · last repo commit 2024-11-09 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,716,000 downloads/mo, #2,046 on PyPI
Alternatives
Verify before relying
pip install flexparser
from dataclasses import dataclass
import flexparser as fp
@dataclass(frozen=True)
class Assignment(fp.ParsedStatement):
lhs: str
rhs: str
@classmethod
def from_string(cls, s):
if "<-" not in s:
return None
lhs, rhs = s.split("<-")
return cls(lhs.strip(), rhs.strip())
parsed = fp.parse("file.txt", Assignment)
for statement in parsed.iter_statements():
print(statement)- Whether the package handles nested or recursive block structures beyond the single-level Block example shown.
- Performance characteristics when parsing large files or deeply nested structures.
- Whether custom error recovery or partial parsing is supported beyond returning None or a ParsingError.
What it is and what it does
flexparser is a parser framework that lets you define custom statement types as frozen dataclasses with a `from_string` classmethod. Instead of writing a traditional recursive-descent or grammar-based parser, you write one class per statement type and the framework handles iteration, error collection, and file I/O. Each parsed statement is automatically annotated with line and column positions, raw text, and a content hash.
The framework distinguishes between statements the parser doesn't recognize (returns None), valid statements, and parsing errors (subclasses of ParsingError). It also supports grouping statements into blocks with begin/end markers. The result is a sequence of typed objects you can iterate over, making downstream processing type-safe and straightforward. It depends only on typing-extensions and requires Python 3.9 or later.
Use it for
- Parse domain-specific languages or configuration formats where each line type maps to a distinct dataclass.
- Build error-tolerant parsers that collect all parsing failures and continue, reporting them at the end.
- Parse structured text files (logs, reports, DSLs) where you want position tracking and type safety without writing a grammar.
- Validate and extract data from line-oriented text where different line patterns need different handling logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a lightweight, type-safe parser for line-oriented text and don't require active maintenance.
The low dependency footprint and permissive license make it a reasonable choice for small-to-medium parsing tasks. The dormant status means no new features or bug fixes are likely, so evaluate whether the current API and behavior meet your needs before committing.
Install
flexparser on PyPI
Before you install
Low friction: pure Python wheel with only typing-extensions as a runtime dependency. Maintenance is dormant—last release was 2024-11-07 and last commit 2024-11-09, with no recent activity; the package is stable but not actively developed.
License in practice
BSD-3-Clause is permissive and imposes no significant restrictions on use or redistribution, making it suitable for most commercial and open-source projects.
Quickstart
pip install flexparser
from dataclasses import dataclass
import flexparser as fp
@dataclass(frozen=True)
class Assignment(fp.ParsedStatement):
lhs: str
rhs: str
@classmethod
def from_string(cls, s):
if "<-" not in s:
return None
lhs, rhs = s.split("<-")
return cls(lhs.strip(), rhs.strip())
parsed = fp.parse("file.txt", Assignment)
for statement in parsed.iter_statements():
print(statement)
Verify before relying
- Whether the package handles nested or recursive block structures beyond the single-level Block example shown.
- Performance characteristics when parsing large files or deeply nested structures.
- Whether custom error recovery or partial parsing is supported beyond returning None or a ParsingError.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping-extensions |
| Maintenance | Dormant 645 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,716,000 / month, #2,046 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: System :: FilesystemsTopic :: Utilities |
Evidence: flexparser-0.4-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 › “dataclass-based parser”
- flexparserflexparser lets you build parsers by writing dataclasses with a…
- draccusDraccus parses command-line arguments and configuration files into…
- coqpitCoqpit provides configuration management through Python dataclasses…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also construct-classes · argparse-dataclass · databind · simple-parsing · rply · dataclass-factory · dacite · databind.json · typed-json-dataclass · dataclasses