tree-sitter-language-pack
Comprehensive collection of 160+ tree-sitter language parsers
Description
Tree Sitter Language Pack
This package bundles a comprehensive collection of tree-sitter languages as both source distribution and pre-built wheels.
Support This Project
If you find tree-sitter-language-pack useful, please consider sponsoring the development:
<a href="https://github.com/sponsors/Goldziher"><img src="https://img.shields.io/badge/Sponsor-%E2%9D%A4-pink?logo=github-sponsors" alt="Sponsor on GitHub" height="32"></a>
Your support helps maintain and improve this package for the community! 🚀
Installation
pip install tree-sitter-language-pack
Important Notes
- This package started life as a maintained and updated fork of tree-sitter-languages by Grant Jenks, and it incorporates code contributed by ObserverOfTime (see this PR).
- This package is MIT licensed and the original package of which this is a fork has an Apache 2.0 License. Both licenses are available in the LICENSE file.
- All languages bundled by this package are licensed under permissive open-source licenses (MIT, Apache 2.0 etc.) only - no GPL licensed languages are included.
- This package follows the general Python life-cycle and now requires Python 3.10 or newer. We align with tree-sitter 0.25.x and newer, which dropped Python 3.9 support ahead of the upstream EOL.
Features
- 165+ Languages: Support for all major programming languages and many domain-specific languages
- Pre-built Wheels: Easy installation with no compilation required
- Type-Safe: Full typing support for better IDE integration and code safety
- Zero GPL Dependencies: All bundled languages use permissive licenses (MIT, Apache 2.0, etc.)
Usage
This library exposes three functions: get_binding, get_language, and get_parser.
from tree_sitter_language_pack import get_binding, get_language, get_parser
python_binding = get_binding("python") # this is a pycapsule object pointing to the C binding
python_lang = get_language("python") # this is an instance of tree_sitter.Language
python_parser = get_parser("python") # this is an instance of tree_sitter.Parser
See the list of available languages below to get the name of the language you want to use.
Development Setup
To work on the package locally you will need Python 3.10+ and the uv toolchain.
# Install runtime dependencies
uv sync --no-install-project
# Install the tree-sitter CLI used for code generation
npm install -g tree-sitter-cli
# Install prek hooks (Rust-based pre-commit replacement)
uv tool install prek
prek install
prek install --hook-type commit-msg
# Fetch bundled language vendors and build native extensions
uv run --no-sync scripts/clone_vendors.py
PROJECT_ROOT=. uv run setup.py build_ext --inplace
# Run the full test suite
PROJECT_ROOT=. uv run --no-sync pytest tests
# Execute all lint/format checks
prek run --all-files
Available Languages
Each language below is identified by the key used to retrieve it from the get_language and get_parser functions.
- actionscript - MIT License
- ada - MIT License
- agda - MIT License
- apex - MIT License
- arduino - MIT License
- asm - MIT License
- astro - MIT License
- bash - MIT License
- beancount - MIT License
- bibtex - MIT License
- bicep - MIT License
- bitbake - MIT License
- bsl - MIT License
- c - MIT License
- cairo - MIT License
- capnp - MIT License
- chatito - MIT License
- clarity - MIT License
- clojure - CC0 1.0 Universal License
- cmake - MIT License
- cobol - MIT License
- comment - MIT License
- commonlisp - MIT License
- cpon - MIT License
- cpp - MIT License
- csharp - MIT License
- css - MIT License
- csv - MIT License
- cuda - MIT License
- d - MIT License
- dart - MIT License
- dockerfile - MIT License
- doxygen - MIT License
- dtd - MIT License
- elisp - MIT License
- elixir - MIT License
- elm - MIT License
- embeddedtemplate - MIT License
- erlang - MIT License
- fennel - MIT License
- firrtl - Apache License 2.0
- fish - Unlicense license
- fortran - MIT License
- fsharp/fsharp_signature - MIT License
- func - MIT License
- gdscript - MIT License
- gitattributes - MIT License
- gitcommit - WTFPL License
- gitignore - MIT License
- gleam - Apache-2.0 license
- glsl - MIT License
- gn - MIT License
- go - MIT License
- gomod - MIT License
- gosum - MIT License
- graphql - MIT License
- groovy - MIT License
- gstlaunch - MIT License
- hack - MIT License
- hare - MIT License
- haskell - MIT License
- haxe - MIT License
- hcl - Apache License 2.0
- heex - MIT License
- hlsl - MIT License
- html - MIT License
- hyprlang - MIT License
- ispc - MIT License
- ini - Apache License 2.0
- janet - BSD-3-Clause license
- java - MIT License
- javascript - MIT License
- jsdoc - MIT License
- json - MIT License
- jsonnet - MIT License
- julia - MIT License
- kconfig - MIT License
- kdl - MIT License
- kotlin - MIT License
- latex - MIT License
- [li