skillfed

mo-parsing

Another PEG Parsing Tool

mo-parsing v8.694.25301 227.1K downloads/30d#9,186 on PyPI4
Permissive license MIT AGING released

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-parsing

uv

uv add mo-parsing

poetry

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 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

Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

PEG parser generatorgrammar definition with operatorsparse string to treepyparsing forklanguage parsing librarytext parsing DSLinfix operator parsing
parser-generatorpeg-parsingdsl

More Libraries packages