--- id: pyleri version: "1.5.1" license: unclear license_treatment: permissive maintenance: active --- # pyleri — Python Left-Right Parser License: permissive · Maintenance: active · Downloads: 124.6K/mo ## What it is and what it does Pyleri is a parser generator that lets you define a formal grammar as a Python class, then use it to parse and validate strings. You compose grammars from building blocks like Keywords, Regex patterns, Sequences, and Choices, then call parse() to check whether a string matches. The parser returns a result object with validation status, position, parse tree, and error expectations. The package's main strength is cross-language export: once you define a grammar in Python, you can generate equivalent parsers in JavaScript (via jsleri), C (via libcleri), Go (via goleri), and Java (via jleri). This makes it useful for projects that need consistent parsing logic across multiple codebases—for instance, a web app with a Python backend and JavaScript frontend, or a database query language that needs to validate input in multiple services. Use it for: - Define a query language grammar once in Python and export it to JavaScript for browser-side validation and autocompletion - Validate domain-specific language (DSL) syntax in a Python application before processing - Build a parser for a custom configuration file format and reuse it across Python, C, and Go microservices - Generate error messages showing what tokens are expected at a parse failure position - Create a grammar for a database query language and export it to multiple client libraries ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pyleri is a left-right parser generator that lets you define a grammar in Python and parse strings against it, with the ability to export that grammar to JavaScript, C, Go, and Java. Yes. Pyleri is actively maintained, has no dependencies, installs easily, carries no security vulnerabilities, and solves a real problem—defining grammars once and reusing them across languages. It's most valuable if you need consistent parsing logic in multiple codebases; for single-language parsing, a simpler tool may suffice. ## Install pip install pyleri uv add pyleri poetry add pyleri ## Installing pyleri Before you install: Low install friction with no runtime dependencies. The package is actively maintained, with a recent release 39 days ago and consistent commit activity. License in practice: Licensed under MIT (permissive), so you can use, modify, and distribute the package freely in commercial and private projects. Quickstart: from pyleri import Grammar, Keyword, Regex, Sequence class MyGrammar(Grammar): k_hi = Keyword('hi') r_name = Regex('(?:"(?:[^"]*)")+') START = Sequence(k_hi, r_name) my_grammar = MyGrammar() result = my_grammar.parse('hi "Iris"') print(result.is_valid) # True Verify before relying: - Whether the package supports Python 3.11+ despite classifiers only listing up to 3.10 - Performance characteristics when parsing large or deeply nested grammars - Whether exported grammars in other languages maintain full feature parity with the Python version ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 124.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags parser generator python, grammar definition language, left-right parser, cross-language grammar export, autocompletion parser, query language parser, syntax validation, parser-generator, cross-language, grammar-definition [View on SkillFed](https://skillfed.io/packages/pyleri) · [View on PyPI](https://pypi.org/project/pyleri/)