skillfed

PyMeta3

Pattern-matching language based on OMeta for Python 3 and 2

pymeta3 v0.5.1 659.0K downloads/30d#5,465 on PyPI18
Permissive license MIT License Abandoned released

What it is and what it does

PyMeta3 is a pattern-matching language implementation based on OMeta, an object-oriented grammar formalism. It lets you define parsing rules using a compact PEG-like syntax and compiles them into Python classes with methods corresponding to grammar rules. Each rule specifies parsing expressions that consume input and return values on successful match.

The package is useful for building parsers, lexers, and tree transformers without writing imperative parsing code. You define rules declaratively (e.g., `foo ::= 'x' 'y' => result`), and PyMeta3 handles the matching logic. It has no runtime dependencies, but the project is no longer maintained—the last release was 2015-02-22 and the repository shows no activity since 2019-01-09.

Use it for:

  • Build a simple expression parser or calculator by defining grammar rules for operators and operands
  • Implement a domain-specific language (DSL) lexer and parser without hand-coding recursive descent logic
  • Transform structured text or code by parsing it into a tree and applying pattern-matching rules
  • Prototype a language or configuration file parser quickly using declarative grammar syntax

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyMeta3 compiles pattern-matching grammars based on Parsing Expression Grammars (PEGs) into Python classes, enabling compact syntax for lexing, parsing, and tree transformation.

No—unless you are maintaining legacy code already using PyMeta3. The package is abandoned (last commit 2019-01-09, no releases since 2015-02-22), has high install friction, and its Python 3 compatibility is unverified beyond Python 3.4. Consider actively maintained alternatives for new projects.

Install

pymeta3 on PyPI

pip

pip install pymeta3

uv

uv add pymeta3

poetry

poetry add pymeta3

Installing PyMeta3

Before you install

Installation friction is high due to source distribution only; the package is abandoned (last commit 2019-01-09, no releases since 2015-02-22), so expect no maintenance or bug fixes.

License in practice

MIT License permits commercial and private use with minimal restrictions, making it legally safe to adopt if you accept the maintenance risk.

Quickstart

from pymeta.grammar import OMeta

grammar = """ones ::= '1' '1' => 1
twos ::= '2' '2' => 2
stuff ::= ( | )+"""
Example = OMeta.makeGrammar(grammar, {})
g = Example("11221111")
result, error = g.apply("stuff")

No explicit Python version requirement stated; classifiers list Python 2.7, 3.3, and 3.4, but compatibility with modern Python versions is unverified.

Verify before relying

  • Whether PyMeta3 actually works on Python 3.5+ despite classifiers only listing up to 3.4
  • Whether the package has been tested or used successfully in recent years given the 2019 last commit
  • Whether high install friction reflects build complexity or is merely a packaging choice

Package facts

License MIT License (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 4,191 days since the last release
Last repo commit
First released
Downloads 659,021/month — #5,465 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: PyMeta3-0.5.1.tar.gz

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4

Tags

pattern matching language pythonparsing expression grammar pegometa implementationpython parser generatorlexing parsing tree transformationgrammar compiler pythonpeg parser
parser-generatorgrammar-dslabandoned

More Software Development packages