skillfed

lark

a modern parsing library

lark Permissive license MIT Active 5,954 v1.3.1 released

Install

lark on PyPI

pip

pip install lark

uv

uv add lark

poetry

poetry add lark

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 290 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: lark-1.3.1-py3-none-any.whl

Keywords: Earley, LALR, parser, parsing, ast

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: GeneralTopic :: Text Processing :: Linguistic

About lark

from the package's own PyPI description — quoted content, verbatim

Lark is a modern general-purpose parsing library for Python. With Lark, you can parse any context-free grammar, efficiently, with very little code. Main Features: - Builds a parse-tree (AST) automagically, based on the structure of the grammar - Earley parser - Can parse all context-free grammars - Full support for ambiguous grammars - LALR(1) parser - Fast and light, competitive with PLY - Can generate a stand-alone parser - CYK parser, for highly ambiguous grammars - EBNF grammar - Unicode fully supported - Automatic line & column tracking - Standard library of terminals (strings, numbers, names, etc.) - Import grammars from Nearley.js - Extensive test suite - And much more! Since version 1.2, only Python versions 3.8 and up are supported.

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Lark is a parsing library that builds abstract syntax trees from context-free grammars using Earley, LALR(1), or CYK parsers, supporting ambiguous grammars and EBNF syntax with full Unicode support.

Lark has zero runtime dependencies and ships as a pure Python wheel, making installation frictionless. The project is actively maintained with a recent release (290 days ago) and strong community engagement (5954 GitHub stars).

Lark is licensed under MIT (permissive), allowing free use, modification, and distribution in both open-source and commercial projects with minimal restrictions.

Usage

pip install lark==1.3.1

from lark import Lark

grammar = r'''
    start: "hello" NAME
    NAME: /\w+/
'''
parser = Lark(grammar)
tree = parser.parse("hello world")
print(tree.pretty())

Requires Python 3.8 or higher; only Python 3.8+ versions are supported as of version 1.2.

Verdict: Lark is a production-ready, actively maintained parsing library with no dependencies, permissive licensing, and zero known vulnerabilities. It is well-suited for projects requiring flexible grammar-based parsing with minimal installation overhead.

Needs verification

  • Performance characteristics relative to other parsing libraries in real-world use cases
  • Completeness of documentation and community support resources beyond the GitHub repository
context-free grammar parserparse tree AST generatorEarley LALR parser libraryambiguous grammar parsingEBNF parser pythonstandalone parser generationlinguistic parsing library

Similar packages