--- id: mo-parsing version: "8.694.25301" license: MIT license_treatment: permissive maintenance: aging --- # mo-parsing — Another PEG Parsing Tool License: permissive · Maintenance: aging · Downloads: 227.1K/mo ## What it is and what it does mo-parsing is a fork of pyparsing optimized for faster parsing of PEG (Parsing Expression Grammar) languages. You define a grammar by combining predefined parser elements (Word, Literal, etc.) using Python operators, then call parse_string() to parse input text. The result is a ParseResults object that behaves like both a nested list and a dictionary, depending on how you named the matched elements. The package emphasizes speed through regex-based optimization and faster infix operator parsing, and introduces a Whitespace context manager to control what characters are skipped and how the grammar behaves globally. It differs from pyparsing in that ParserElements are immutable—calling add_parse_action() returns a new element rather than modifying the original—and it removes backward-compatibility cruft. The main dependencies are mo-dots and mo-future, both lightweight utility packages. Use it for: - Parse domain-specific languages (DSLs) or configuration file formats into structured data - Build SQL or query parsers where infix operator precedence matters - Extract and transform text with named capture groups into dictionaries for downstream processing - Define grammar rules for log parsing or protocol message decoding - Implement expression evaluators that need to respect operator precedence ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. mo-parsing is a PEG parser generator that lets you define grammars using Python operators and predefined patterns, then parse strings into structured parse trees accessible as lists or dictionaries. Yes, if you need a PEG parser and are comfortable with immutable ParserElement semantics. The low install friction, permissive MIT license, and lack of known vulnerabilities make it safe to try. The 290-day release gap suggests stability but not active development; use it for parsing tasks where pyparsing's API or performance is a concern, but verify performance gains match your use case before committing to a migration. ## Install pip install mo-parsing uv add mo-parsing poetry add mo-parsing ## Installing mo-parsing Before you install: Low install friction with only two runtime dependencies (mo-dots, mo-future). The package is in Beta status and has not seen a release in 290 days, suggesting stable but not actively developed maintenance. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use and modify this package freely provided you retain the license notice. Quickstart: pip install mo-parsing from mo_parsing import Word from mo_parsing.utils import alphas greet = Word(alphas)("greeting") + "," + Word(alphas)("person") + "!" result = greet.parse_string("Hello, World!") print(dict(result)) # {'greeting': 'Hello', 'person': 'World'} Verify before relying: - Whether performance improvements over pyparsing are significant enough to justify migration for typical use cases - How well the package handles complex or deeply nested grammars in practice - Community size and availability of third-party examples beyond the repository ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 227.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags PEG parser generator, grammar definition with operators, parse string to tree, pyparsing fork, language parsing library, text parsing DSL, infix operator parsing, parser-generator, peg-parsing, dsl [View on SkillFed](https://skillfed.io/packages/mo-parsing) · [View on PyPI](https://pypi.org/project/mo-parsing/)