pyparsing

Build recursive-descent parsers in Python without a separate grammar file

Library
PyPI
v3.3.2
2,484stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity92
Maintenance84
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture80
Code Quality82
Innovation78
Learning Curve75

pyparsing lets you build parsers for structured or semi-structured text entirely in Python, by combining small parser-element objects (literals, words, numbers, quoted strings) with operators like + (sequence), | (first match), and ^ (longest match) into a grammar object that parses directly. There’s no separate grammar DSL, code-generation step, or external parser-generator tool to run — the grammar is ordinary Python code, which makes it easy to debug, extend, and combine with the rest of an application.

It predates most modern PEG-parser libraries in the Python ecosystem and remains widely used for config-file formats, small DSLs, log-line extraction, and search-query grammars where a full parser-generator toolchain would be overkill.

What You Get

  • A library of composable parser-element primitives (Word, Literal, Regex, QuotedString, Combine, and more) usable directly as Python objects
  • Operator-based grammar composition (+ for sequence, | for first-match-wins, ^ for longest-match, ~ for negation)
  • Parse actions - attach Python callables to grammar elements to transform or validate matched tokens during parsing
  • ParseResults objects supporting both positional and named-field access to parsed tokens, plus nested/grouped results
  • A pyparsing.diagram module for generating railroad-diagram visualizations of a grammar, plus a common module of ready-made tokens (numbers, identifiers, comments)

Common Use Cases

  • Parsing small domain-specific languages or config-file formats without introducing a separate grammar-generator build step
  • Extracting structured fields from semi-structured log lines or command output
  • Building custom search-query or filter-expression grammars for an application’s search bar
  • Validating and transforming input during parsing itself via attached parse actions, rather than in a separate post-processing pass

Under The Hood

Architecture - core.py implements the parser-combinator engine: every grammar element is a ParserElement subclass with a parseImpl method, and composite elements (And, Or, MatchFirst, Each) recursively call into their children’s parseImpl during a scan over the input string, with results.py’s ParseResults accumulating matched tokens (including named results set via .set_results_name()) as parsing proceeds; actions.py implements the parse-action callback mechanism that lets grammar authors hook into successful matches.

Tech Stack - Pure Python with no runtime dependencies, distributed with inline type stubs (py.typed) for static type checkers; the pyparsing/tools and pyparsing/diagram subpackages add optional railroad-diagram grammar visualization (built on railroad-diagrams) as an extra rather than a hard dependency, keeping the core install lightweight.

Code Quality - The library ships an explicit testing.py module with TestParseResultsAsserts-style helpers specifically to make grammars written with pyparsing easier for consumers to unit-test, on top of its own large internal test suite; exceptions.py and warnings.py provide structured parse-error reporting with line/column context rather than generic Python exceptions, which matters a lot for a parsing library’s usability.

API Design - Composing grammars via Python operator overloading (Word(alphas) + '=' + Word(nums)) is the library’s signature ergonomic choice — grammars read close to the structure they describe and stay debuggable with ordinary Python tooling (breakpoints, print statements), at some cost of operator-precedence surprises that the docs and cookbook examples work to head off.

Used by 11 apps in this directory

Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
Python
100%
Apache 2.0

ClearML

Devops · Automation

6,827

Auto-magical MLOps platform that tracks experiments, versions data, orchestrates pipelines, and serves models with just two lines of code.

View details
94
Repo Health
79
Technical
69
Dependency
Built with
Python100%
Updated yesterday
C++
69%
Apache 2.0

ClickHouse

Databases · Analytics · Data Engineering

49,325

Open-source column-oriented database that delivers real-time analytical queries on petabyte-scale data with millisecond latency.

View details
95
Repo Health
90
Technical
68
Dependency
Built with
C++69%
Python13%
Updated today
Shell
48%
MIT

Dokku

Devops · Hosting Control Panel

32,105

The smallest PaaS implementation you've ever seen — deploy apps via git push using Docker and Heroku buildpacks on your own server.

View details
93
Repo Health
85
Technical
75
Dependency
Built with
Shell48%
Go48%
Updated today
C++
74%
Other

Dragonfly

Databases · Developer Tools · Devops

31,013

A modern Redis and Memcached replacement engineered for multi-core servers — delivering 25x more throughput, better cache hit rates, and up to 80% lower memory consumption with full API compatibility.

View details
90
Repo Health
9
Technical
71
Dependency
Built with
C++74%
Python16%
Updated today
Python
64%
BSD 3

Flagsmith

Developer Tools · Devops · Ab Testing Experimentation

6,518

Open-source feature flagging, remote config, and A/B/multivariate testing platform for web, mobile, and server-side apps — self-host or use the hosted SaaS.

View details
91
Repo Health
82
Technical
65
Dependency
Built with
Python64%
TypeScript31%
Updated today
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,083

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
62
Repo Health
81
Technical
66
Dependency
Built with
TypeScript91%
Updated 3 days ago
C++
66%
Other

Memgraph

Databases · AI Development

4,347

High-performance in-memory graph database for AI context and real-time analytics

View details
90
Repo Health
79
Technical
70
Dependency
Built with
C++66%
Python18%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search