pyleri
Python Left-Right Parser
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 on this page — 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
pyleri on PyPI
pip
pip install pyleriuv
uv add pyleripoetry
poetry add pyleriInstalling 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 | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 39 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 124,563/month — #11,863 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyleri-1.5.1-py3-none-any.whl
Keywords: parser, grammar, autocompletion
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
lark-jsLark-js is a command-line tool that generates…
permissive · top 15,000 on PyPI
tree-sitter-javaProvides a Java language grammar for…
permissive · top 5,000 on PyPI
mo-parsingmo-parsing is a PEG parser generator that lets…
permissive · top 15,000 on PyPI
tree-sitter-goProvides a Go language grammar for tree-sitter,…
permissive · top 5,000 on PyPI
tree-sitter-pythonProvides a Python grammar for tree-sitter,…
permissive · top 5,000 on PyPI
TatSuTatSu compiles extended EBNF grammars into…
permissive · top 5,000 on PyPI
pygmarsPygmars builds lightweight lexers and parsers…
permissive · top 15,000 on PyPI
tree-sitter-groovyProvides a Groovy language grammar for…
permissive · top 5,000 on PyPI
tree-sitter-regexProvides a tree-sitter grammar for parsing…
permissive · top 5,000 on PyPI