--- id: parsley version: "1.3" license: MIT License license_treatment: permissive maintenance: abandoned --- # Parsley — Parsing and pattern matching made easy. License: permissive · Maintenance: abandoned · Downloads: 1.3M/mo ## What it is and what it does Parsley is a parsing library that implements OMeta, an object-oriented pattern-matching language. Instead of using traditional parser generators like yacc or ANTLR that compile to state machine tables, Parsley uses the PEG (Parsing Expression Grammar) algorithm, where each grammar rule reads like a Python expression. You define rules using a readable syntax—sequences, alternatives, repetition, lookahead, and embedded Python actions—then call makeGrammar() to compile them into a Python class with methods for each rule. The library is designed for developers who find traditional parser generators intimidating or cumbersome. Rules are evaluated in order (unlike table-driven parsers), and you can bind values, call other rules, and execute Python expressions directly within the grammar. It trades the power of LR parsing for simplicity and readability, making it suitable for domain-specific languages, configuration formats, and other structured text parsing tasks where the grammar fits the PEG model. Use it for: - Parse domain-specific languages or configuration file formats where PEG semantics are sufficient - Build simple expression evaluators or query languages with embedded Python actions - Tokenize and structure text when traditional regex or string splitting is too rigid - Prototype parsers quickly without learning yacc, bison, or ANTLR state machine concepts - Define grammar rules that read naturally as Python-like expressions for team readability ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parsley is a PEG-based parsing library that compiles grammar rules into Python classes, letting you define parsers using a readable pattern-matching syntax instead of state machine tables. No—unless you are maintaining legacy code already using Parsley. The package is abandoned (last release 2015, no commits since), with no Python version guarantee and no active maintenance. For new projects, use maintained PEG parsers like pyparsing or lark, which offer similar readability with ongoing support and bug fixes. ## Install pip install parsley uv add parsley poetry add parsley ## Installing Parsley Before you install: Installation is straightforward with no runtime dependencies. However, the package is abandoned—last released in 2015 with no commits or maintenance signals since. Use only if you accept that bugs and compatibility issues will not be addressed. License in practice: MIT License permits commercial and private use, modification, and distribution with minimal restrictions, making it legally safe to adopt from a licensing perspective. Quickstart: from parsley import makeGrammar grammar = """ ones = '1' '1' -> 1 twos = '2' '2' -> 2 stuff = (ones | twos)+ """ Example = makeGrammar(grammar, {}) g = Example("11221111") result = g.stuff() Verify before relying: - Whether Parsley remains compatible with current Python versions (no requires_python specified in metadata) - Whether the OMeta semantics and PEG algorithm implementation are suitable for your specific parsing task - Community forks or maintained alternatives that may have addressed issues since 2015 ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags PEG parser generator, pattern matching language, grammar parsing library, OMeta implementation, readable parser DSL, text parsing without yacc, declarative grammar rules, parser-generator, peg-parsing, abandoned [View on SkillFed](https://skillfed.io/packages/parsley) · [View on PyPI](https://pypi.org/project/parsley/)