--- id: rply version: "0.7.8" license: BSD 3-Clause License license_treatment: permissive maintenance: abandoned --- # rply — A pure Python Lex/Yacc that works with RPython License: permissive · Maintenance: abandoned · Downloads: 542.3K/mo ## What it is and what it does RPLY is a parser generator library that lets you define lexical and syntactic rules for parsing custom languages or domain-specific syntax. You write token rules (lexer) and grammar productions (parser) as Python decorators, then build a lexer and parser that can tokenize and parse input strings. It's a direct port of PLY (Python Lex-Yacc) with a cleaner API and support for RPython, a statically-typed Python subset used by PyPy. The library is designed for building interpreters, domain-specific languages, or any tool that needs to parse structured text. It handles operator precedence, error reporting with source positions, and optional caching of compiled grammars. The box pattern (wrapping values in classes) is built in for RPython compatibility but can be ignored in pure-Python projects. Use it for: - Build a simple calculator or expression evaluator that parses and computes mathematical expressions. - Create a domain-specific language (DSL) parser for configuration files or query languages. - Implement an interpreter for a toy programming language or scripting syntax. - Parse structured text formats where regex alone is insufficient. - Develop a PyPy-compatible parser when RPython support is required. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. RPLY is a pure Python parser generator that creates lexers and parsers from grammar rules, compatible with both standard Python and RPython. Yes, if you need a parser generator and are comfortable with abandoned software. RPLY is stable, has no known vulnerabilities, and works well for building parsers in pure Python. However, it has received no updates since January 2021 and is no longer maintained—use it only for projects where you can tolerate no future fixes or Python version support updates. For active alternatives, consider PLY or more modern parser libraries. ## Install pip install rply uv add rply poetry add rply ## Installing rply Before you install: Installation is straightforward with a single lightweight dependency (appdirs) and a pure-Python wheel. However, the package is abandoned—last released in January 2021 with no activity since, so expect no bug fixes or maintenance. License in practice: BSD 3-Clause License is permissive, allowing commercial and private use with minimal restrictions; attribution and license inclusion are required. Quickstart: pip install rply from rply import LexerGenerator, ParserGenerator from rply.token import BaseBox lg = LexerGenerator() lg.add("NUMBER", r"\d+") lg.add("PLUS", r"\+") lg.ignore(r"\s+") pg = ParserGenerator(["NUMBER", "PLUS"]) @pg.production("expr : NUMBER PLUS NUMBER") def expr(p): return int(p[0].getstr()) + int(p[2].getstr()) lexer = lg.build() parser = pg.build() result = parser.parse(lexer.lex("1 + 2")) Requires understanding of lexer/parser concepts; RPython support is optional but the box pattern (wrapping values) is necessary for RPython compatibility. Verify before relying: - Whether the package still works reliably with Python 3.8+ given the 2021 release date and no recent maintenance. - Whether cached parsers (cache_id feature) remain compatible across Python versions without manual invalidation. ## Package facts - License: BSD 3-Clause License (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 542.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags parser generator python, lexer yacc ply, grammar rule parser, rpython parser, token lexer generator, lex yacc alternative, parser-generator, lexer, rpython [View on SkillFed](https://skillfed.io/packages/rply) · [View on PyPI](https://pypi.org/project/rply/)