tree-sitter
Python bindings for Tree-sitter parser library for syntax analysis and code transformation.
Linting and formatting PyPI MIT
How tree-sitter is used
tree-sitter is a dependency in 26 of the 6,208 public GitHub projects set up for AI coding agents that we scanned (1.6% of the 1,622 Python ones), #25 of 72 in linting and formatting. Counting the projects our scan samples by dependency (Solana 2,661, Ethereum and EVM 1,496, 3D and games 2,818, agent frameworks and SDKs 10,983), it appears in 158; those are left out of every share on this page. The most used alternative in our scan is Checkov (26 projects). Projects that use it most often also use Model Context Protocol SDK (Python) (80.8%), Pydantic (73.1%), FastAPI (57.7%).
tree-sitter popularity over time
Gid Score 56: downloads 85, use in agent projects 57, GitHub stars 18, downloads trend 51 (each 0-100). How it is calculated.
Often used with tree-sitter
| Model Context Protocol SDK (Python) | 80.8% of tree-sitter projects · 10.1× more than average |
|---|---|
| Pydantic | 73.1% of tree-sitter projects · 8.5× more than average |
| FastAPI | 57.7% of tree-sitter projects · 7.7× more than average |
| PyYAML | 57.7% of tree-sitter projects · 9.7× more than average |
| Uvicorn | 57.7% of tree-sitter projects · 7.5× more than average |
| tree-sitter-typescript (Python) | 50.0% of tree-sitter projects · 238.8× more than average |
| python-dotenv | 46.2% of tree-sitter projects · 5.0× more than average |
| Tree-sitter JavaScript | 46.2% of tree-sitter projects · 238.8× more than average |
By coding agent
| Claude Code | 0.6% of projects set up for it |
|---|---|
| Cursor | 0.4% of projects set up for it |
| GitHub Copilot | 0.3% of projects set up for it |
Share of public repos configured for each agent that list tree-sitter as a dependency.
Install
| Package | pip install tree-sitter |
|---|---|
| Main stacks | Python (26) |
| Example projects | bobmatnyc/claude-mpm, Consiliency/Code-Index-MCP, aanno/cocoindex-code-mcp-server, jagoff/memo, mimfort/rag_for_git |
Alternatives to tree-sitter
Tools that do the same job, so a project picks one or the other. Add-ons and libraries used alongside tree-sitter are not listed here; they are in "Often used with".
| Tool | Gid Score | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|---|
| Checkov pypi Static analysis tool for infrastructure-as-code to detect security and compliance issues. |
51 | 26 (1.6%) | 1.2M | 9,084 | Apache-2.0 |
| Bandit pypi Security-focused static analyzer for identifying vulnerabilities in Python code. |
57 | 12 (0.7%) | 6.5M | 8,325 | Apache-2.0 |
| Pylint pypi Python static code analyzer for detecting errors and style issues. |
60 | 12 (0.7%) | 9.1M | 5,739 | GPL-2.0-or-later |
More in Linting and formatting: ESLint Prettier Biome oxlint oxfmt Knip stylelint ESLint Import Resolver TypeScript