mo-parsing
Another PEG Parsing Tool
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 on this page — 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
mo-parsing on PyPI
pip
pip install mo-parsinguv
uv add mo-parsingpoetry
poetry add mo-parsingInstalling 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 | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — mo-dots, mo-future |
| Maintenance | aging — 290 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 227,111/month — #9,186 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mo_parsing-8.694.25301-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
parsimoniousParsimonious is a pure-Python PEG (parsing…
permissive · top 5,000 on PyPI
mo-sql-parsingParses SQL queries into JSON-serializable parse…
copyleft · top 15,000 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
PyMeta3PyMeta3 compiles pattern-matching grammars…
permissive · top 15,000 on PyPI
ParsleyParsley is a PEG-based parsing library that…
permissive · top 5,000 on PyPI
funcparserlibFuncparserlib is a recursive descent parsing…
permissive · top 15,000 on PyPI
pyPEG2pyPEG2 is a PEG (Parsing Expression Grammar)…
copyleft · top 15,000 on PyPI
pyleriPyleri is a left-right parser generator that…
permissive · top 15,000 on PyPI
TatSuTatSu compiles extended EBNF grammars into…
permissive · top 5,000 on PyPI