tree-sitter-language-pack is a Python library providing pre-compiled Tree-sitter parsers for over 300 programming languages. It offers a unified `process()` API for efficient parsing, advanced code analysis, and intelligent code chunking. The library is actively maintained with frequent releases, typically introducing new language grammars and API enhancements.
pip install tree-sitter-language-packVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core `process()` API to extract structured intelligence from source code, including functions, diagnostics, and comments. It also shows how to use AST-aware chunking for breaking down larger code blocks. The library automatically downloads necessary language parsers on demand.
Ensure you are using the correct package name `tree-sitter-language-pack` for Python and refer to the latest documentation for CLI installation (`cargo install ts-pack-cli` or `brew install kreuzberg-dev/tap/ts-pack`).
Upgrade to v1.3.3 or newer to resolve issues with dynamic loading and `c_symbol` overrides for affected languages.
Prefer using the `process()` API with `ProcessConfig` for most code intelligence tasks to leverage the full capabilities and consistent interface of the library.
Rely primarily on `tree-sitter-language-pack` for all your grammar needs to maintain consistency. If interoperability is required, carefully manage `tree-sitter` versions and compilation flags.
Use `from tree_sitter_languages import get_language, Language` to import the necessary components.
Check the available languages using `tree_sitter_languages.get_available_languages()` and use the exact string provided in the list.
Ensure the `tree-sitter` package is correctly installed and its C dependencies are met; on some systems, this might require installing development packages (e.g., `libtree-sitter-dev`) or reinstalling `pip install tree-sitter tree-sitter-language-pack`.
First, get the `Language` object using `get_language()` and then pass it to the `process()` function: `from tree_sitter_languages import get_language, process; code_string = 'print("hello")'; python_language = get_language('python'); result = process(code_string, python_language)`.