skillfed

Arpeggio

Packrat parser interpreter

arpeggio v2.0.3 2.1M downloads/30d#3,316 on PyPI288
Permissive license MIT Active released

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 arpeggio

uv

uv add arpeggio

poetry

poetry add arpeggio

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: CompilersTopic :: Software Development :: InterpretersTopic :: Software Development :: Libraries :: Python Modules

Tags

PEG parserrecursive descent parserpackrat parsergrammar-based parsinglanguage parser librarytext parsingDSL parser
parsingpeg-grammarcompiler-tools

More Python Modules packages