Skip to main content

Modgrammar is a general-purpose library for building language parsers and interpreters using context-free grammar definitions in Python. Language parsing rules (grammars) are defined as standard Python classes, which can then be used to parse and validate input strings or files into meaningful data structures. Possible applications range from simple input validation, to complex expression evaluation, to full-fledged programming language parsing for compilers or interpreters.

Some features include:

  • Pure-Python cross-platform design.

  • Full Unicode support

  • Grammars are defined using standard Python syntax.

  • Supports arbitrarily complex grammars, including recursion.

  • Defining a grammar automatically creates a working parser in the process (no compilation steps or lengthy startup times).

  • Parse results contain full parse-tree information, including heirarchical tokenization of the input.

  • Parse result objects can have custom methods, producing rich data objects.

  • Modular grammar design supports distributing grammars as python library modules, combining grammars from multiple sources into larger grammars, and even parameterized grammar definitions.

Metadata

Release files for modgrammar 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modgrammar 0.10
File Size Uploaded
modgrammar-0.10.tar.gz 86.4 kB Details

Release files / modgrammar-0.10.tar.gz

Download URL modgrammar-0.10.tar.gz
Size 86.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b957cc9cc5bcc4da3b0795d63d33d421cf28db186acab74f83847de8311fa09a
BLAKE2b-256 checksum
How to use checksums
6f24f9f2756af2de13ebb3565f03720fd7baee7cbc385320da0243db8823a8c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.10 This release

1 release file

0.9.1

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page