tree-sitter
Python bindings to the Tree-sitter parsing library
Install
tree-sitter on PyPI
pip
pip install tree-sitteruv
uv add tree-sitterpoetry
poetry add tree-sitterPackage facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 44 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: tree_sitter-0.26.0-cp310-cp310-macosx_10_9_x86_64.whl; tree_sitter-0.26.0-cp310-cp310-macosx_11_0_arm64.whl; tree_sitter-0.26.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tree_sitter-0.26.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; tree_sitter-0.26.0-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; tree_sitter-0.26.0-cp310-cp310-musllinux_1_2_x86_64.whl; tree_sitter-0.26.0-cp310-cp310-win_amd64.whl; tree_sitter-0.26.0-cp310-cp310-win_arm64.whl; tree_sitter-0.26.0-cp311-cp311-macosx_10_9_x86_64.whl; tree_sitter-0.26.0-cp311-cp311-macosx_11_0_arm64.whl; tree_sitter-0.26.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tree_sitter-0.26.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; tree_sitter-0.26.0-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; tree_sitter-0.26.0-cp311-cp311-musllinux_1_2_x86_64.whl; tree_sitter-0.26.0-cp311-cp311-win_amd64.whl; tree_sitter-0.26.0-cp311-cp311-win_arm64.whl; tree_sitter-0.26.0-cp312-cp312-macosx_10_13_x86_64.whl; tree_sitter-0.26.0-cp312-cp312-macosx_11_0_arm64.whl; tree_sitter-0.26.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tree_sitter-0.26.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Keywords: incremental, parsing, tree-sitter
About tree-sitter
from the package's own PyPI description — quoted content, verbatim
Python Tree-sitter
![CI][ci] ![pypi][pypi] ![docs][docs]
This module provides Python bindings to the [tree-sitter] parsing library.
Installation
The package has no library dependencies and provides pre-compiled wheels for all major platforms.
> [!NOTE] > If your platform is not currently supported, please submit an [issue] on GitHub.
pip install tree-sitter
Usage
Setup
Install languages
Tree-sitter language implementations also provide pre-compiled binary wheels. Let's take [Python][tree-sitter-python] as an example.
pip install tree-sitter-python
Then, you can load it as a Language object:
import tree_sitter_python as tspython
from tree_sitter import Language, Parser
PY_LANGUAGE = Language(tspython.language())
Basic parsing
Create a Parser and configure it to use a language:
parser = Parser(PY_LANGUAGE)
Parse some source code:
```python tree = parser.parse( bytes( """ def foo(): if bar: baz() """,...
Read as markdown · JSON record · Source repository · Homepage · Docs
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
Python bindings to the tree-sitter incremental parsing library, enabling syntax tree construction and traversal for code analysis across multiple programming languages.
Medium install friction due to compiled wheels, but well-supported across platforms (Python 3.10 and later, macOS, Linux, Windows, ARM/RISC-V). Active maintenance with release 44 days ago and 1485 GitHub stars.
Permissive license treatment allows use in commercial and proprietary projects without restriction.
Usage
pip install tree-sitter
from tree_sitter import Language, Parser
parser = Parser()
tree = parser.parse(b'def foo():\n pass')
Requires Python >=3.10; language grammar packages must be installed separately to configure the parser.
Verdict: Stable, actively maintained parser binding with zero known vulnerabilities and broad platform coverage. No runtime dependencies and permissive licensing make it suitable for production use. Medium install friction is manageable via pre-built wheels across major platforms.
Needs verification
- Whether language grammar packages are maintained at the same cadence as the core binding.
- Performance characteristics for large codebases or real-time parsing scenarios.
- Specific MIT license details, as license_raw and license_spdx are not populated in the fact sheet.
Similar packages
permissive · top 1,000 on PyPI
regexpermissive · top 100 on PyPI
tree-sitter-bashpermissive · top 1,000 on PyPI
google-pastapermissive · top 1,000 on PyPI
asttokenspermissive · top 1,000 on PyPI
executingpermissive · top 1,000 on PyPI
pure-evalpermissive · top 1,000 on PyPI
jmespathpermissive · top 100 on PyPI
rpds-pypermissive · top 100 on PyPI
srslypermissive · top 1,000 on PyPI