--- id: lark-parser version: "0.12.0" license: MIT license_treatment: permissive maintenance: active --- # lark-parser — a modern parsing library License: permissive · Maintenance: active · Downloads: 3.7M/mo ## 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 above — 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 pip install lark-parser uv add lark-parser poetry add lark-parser ## Installing 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: unspecified - Install friction: low - Maintenance: active - Downloads: 3.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags context-free grammar parser, ast parser library, earley lalr parser, parsing library python, grammar-based parsing, syntax tree generator, general-purpose parser, parser-generator, dsl, compiler-tools [View on SkillFed](https://skillfed.io/packages/lark-parser) · [View on PyPI](https://pypi.org/project/lark-parser/)