Arpeggio
Packrat parser interpreter
What it is and what it does
Arpeggio is a parser library that implements Packrat parsing using Parsing Expression Grammars (PEG). It uses recursive descent with memoization to parse input according to user-defined grammar rules. The library is designed for developers who need to build parsers for domain-specific languages, configuration formats, or other structured text without writing hand-coded parsing logic.
The package has no runtime dependencies and is marked as Production/Stable. It supports Python 3.6 through 3.10 and has been actively maintained since its first release in 2014-08-16. The documentation notes that textX provides a higher-level interface to Arpeggio if you need a more convenient API for language definition.
Use it for:
- Build a parser for a custom configuration file format or domain-specific language
- Parse structured text data where you want to define grammar rules declaratively rather than write parsing code
- Create an interpreter or compiler frontend that needs to consume and validate input against a formal grammar
- Extract and transform data from text files with complex, nested structures
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Arpeggio is a recursive descent parser with memoization that implements PEG (Packrat) grammars, letting you define and parse custom languages or structured text formats.
Yes. Arpeggio is a stable, actively maintained parser library with no dependencies and permissive licensing. Install it if you need to build a parser for a custom grammar or language; if you want a higher-level interface for language definition, consider textX instead.
Install
arpeggio on PyPI
pip
pip install arpeggiouv
uv add arpeggiopoetry
poetry add arpeggioInstalling Arpeggio
Before you install
Low install friction with no runtime dependencies. Active maintenance with a recent release in 2025-09-12 and last commit on 2026-08-02; the repository is not archived and has 288 stars.
License in practice
MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
Quickstart
pip install arpeggio
from arpeggio import ParsingExpression, ZeroOrMore, OneOrMore, Optional
from arpeggio import PTNodeVisitor, visit_parse_tree
# Define a simple grammar and parse input
grammar = OneOrMore(ParsingExpression(...))
parse_tree = grammar.parse(input_string)
Verify before relying
- Whether Arpeggio handles left-recursive grammars or has known limitations with certain PEG patterns
- Performance characteristics when parsing large inputs or deeply nested structures
- Whether the package includes built-in error recovery or reporting mechanisms
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 336 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,075,233/month — #3,316 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Arpeggio-2.0.3-py2.py3-none-any.whl
Keywords: parser, PEG, packrat, library, interpreter
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
TatSuTatSu compiles extended EBNF grammars into…
permissive · top 5,000 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
textXtextX is a meta-language for building…
permissive · top 15,000 on PyPI
parsimoniousParsimonious is a pure-Python PEG (parsing…
permissive · top 5,000 on PyPI
funcparserlibFuncparserlib is a recursive descent parsing…
permissive · top 15,000 on PyPI
parsyParsy is a parser combinator library that lets…
permissive · top 5,000 on PyPI
PyMeta3PyMeta3 compiles pattern-matching grammars…
permissive · top 15,000 on PyPI
pyPEG2pyPEG2 is a PEG (Parsing Expression Grammar)…
copyleft · top 15,000 on PyPI
mo-parsingmo-parsing is a PEG parser generator that lets…
permissive · top 15,000 on PyPI
ParsleyParsley is a PEG-based parsing library that…
permissive · top 5,000 on PyPI