Registry / serialization / tree-sitter-lua

tree-sitter-lua

JSON →
library0.5.0pypypi✓ verified 85d ago

Lua grammar for tree-sitter, providing incremental parsing and syntax tree queries for Lua code. Current version 0.5.0 (2025), supports Python >=3.10. Regenerated with tree-sitter 0.26.6. Release cadence is irregular, roughly semiannual.

pip install tree-sitter-lua
INSTALL
IMPORT
SIG · TREE-SITTER-LUA
T
tree-sitter-lua
serializationpythonv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

language
✓ from tree_sitter_lua import language
✗ from tree_sitter_lua import language_lua

Parses a Lua string and prints the S-expression of the syntax tree.

from tree_sitter import Language, Parser from tree_sitter_lua import language_lua LUA_LANGUAGE = Language(language_lua()) parser = Parser() parser.set_language(LUA_LANGUAGE) tree = parser.parse(b"print('hello world')") print(tree.root_node.sexp())
Debug
Known issues
breakingVersion 0.4.0 regenerated the parser with ABI 15, breaking compatibility with tree-sitter <=0.24. Make sure your tree-sitter library is at least 0.25.
fix
Upgrade tree-sitter: pip install --upgrade tree-sitter
affects: >=0.4.0
deprecatedThe old import pattern `from tree_sitter_lua import language` (without underscore) is no longer supported after v0.1.0.
fix
Use `from tree_sitter_lua import language_lua`
affects: >=0.2.0
gotchaThe grammar version (0.5.0) does not match the tree-sitter library version. You must install tree-sitter separately.
fix
Run `pip install tree-sitter` before using tree-sitter-lua.
affects: all
Upgrade
Version history
0.5.0latest on PyPI · released Feb 26, 2026
Audit
Dependencies
tree-sitterrequiredRequired to load and use the grammar.
Agent activity
20 hits · last 30 days
node
16
Amazon
3
OpenAI (training)
1
Resources
tree-sitter-lua — pip install tree-sitter-lua · libregistry