lark

a modern parsing library

MIT 20 个版本 Python >=3.8
安装
pip install lark
poetry add lark
pipenv install lark
conda install lark
描述

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.
版本列表
1.3.1 2025-10-27
1.3.0 2025-09-22
1.2.2 2024-08-13
1.2.1 2024-08-13
1.1.9 2024-01-10
1.1.8 2023-10-23
1.1.7 2023-07-20
1.1.6 2023-07-17
1.1.5 2022-12-06
1.1.4 2022-11-02
1.1.3 2022-10-11
1.1.2 2022-03-01
1.1.1 2022-02-08
1.1.0 2022-02-07
1.0.0 2021-11-15
0.12.0 2021-11-12
0.11.3 2021-05-03
0.11.1 2020-11-16
0.11.0 2020-11-16
0.10.1 2020-10-13