lark-parser
a modern parsing library
What it is and what it does
Lark is a general-purpose parsing library that transforms grammar definitions into working parsers. It supports three parsing algorithms—Earley (handles all context-free grammars including ambiguous ones), LALR(1) (fast and compact), and CYK (for highly ambiguous grammars)—and automatically builds parse trees from input text based on your grammar structure.
The library is designed for minimal boilerplate: you write a grammar in EBNF notation and Lark generates a parser that can immediately process text matching that grammar. It includes conveniences like automatic line and column tracking, a standard library of common terminals (strings, numbers, identifiers), and Unicode support. With no runtime dependencies and support for both Python 2 and 3, it's straightforward to integrate into existing projects.
Use it for:
- Parse domain-specific languages or configuration file formats by defining their grammar rules
- Build compilers or interpreters that need to convert source code into abstract syntax trees
- Extract structured data from text by defining patterns as a context-free grammar
- Implement query languages or expression parsers for applications requiring user-defined syntax
- Generate stand-alone parsers from LALR grammars for deployment without the library
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lark is a parsing library that builds abstract syntax trees from context-free grammars using Earley, LALR(1), or CYK parsing algorithms, with minimal code required.
Yes. Lark is production-stable, dependency-free, actively maintained, and widely used (top 5000 PyPI packages). Choose it if you need to parse structured text or implement a language. The main caveat: the latest release is from 2021-08-30, so verify current Python version compatibility before adopting in new projects.
Install
lark-parser on PyPI
pip
pip install lark-parseruv
uv add lark-parserpoetry
poetry add lark-parserInstalling lark-parser
Before you install
Installation is straightforward with no runtime dependencies. The package is actively maintained with recent commits and has been stable since its first release in 2017-02-11.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install lark-parser
from lark import Lark
grammar = r"""
start: "hello" name
name: /\w+/
"""
parser = Lark(grammar)
tree = parser.parse("hello world")
Verify before relying
- Whether the package receives active maintenance updates beyond the 2021-08-30 latest release date
- Current compatibility with modern Python versions given the last release predates recent Python releases
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,810 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,665,702/month — #2,535 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lark_parser-0.12.0-py2.py3-none-any.whl
Keywords: Earley, LALR, parser, parsing, ast
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
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
lark-jsLark-js is a command-line tool that generates…
permissive · top 15,000 on PyPI
pycep-parserParses Azure Bicep infrastructure-as-code files…
permissive · top 5,000 on PyPI
spark-parserImplements an Earley algorithm parser for…
permissive · top 15,000 on PyPI
textparserA fast text parser library that lets you define…
permissive · top 5,000 on PyPI
plyPLY is a lexer and parser generator for Python…
permissive · top 1,000 on PyPI
bc-python-hcl2Parses HCL2 configuration files (such as…
permissive · top 5,000 on PyPI
rfc3987-syntaxValidates that strings conform to the ABNF…
permissive · top 1,000 on PyPI
slySLY is a pure-Python implementation of lex and…
permissive · top 5,000 on PyPI
tree-sitter-pythonProvides a Python grammar for tree-sitter,…
permissive · top 5,000 on PyPI