# tree-sitter/py-tree-sitter

Python bindings to the Tree-sitter parsing library

Repository: https://github.com/tree-sitter/py-tree-sitter
Canonical: https://ross.abutalabs.com/products/py-tree-sitter
Homepage: https://tree-sitter.github.io/py-tree-sitter/
Language: C
License: MIT
License Family: permissive
Topics: tree-sitter, python, binding
Last push: 2026-08-22T12:22:44+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 78, longevity 100
- inputs: {"age_days": 2723, "days_push": 11, "days_rel": 64, "gap_med": 67.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1491, forks 192 (observed 2026-08-28T04:04:52.500343+00:00)

## What it is
Python bindings to the Tree-sitter incremental parsing library, exposing Parser, Tree, Node, and Query APIs for building concrete syntax trees from source code. It ships pre-compiled wheels with no library dependencies and supports loading separately installed language grammars.

## Use cases
- parse source code into a syntax tree in Python
- build a code linter or analyzer
- extract symbols and structure from code files
- write syntax-aware code search queries
- power syntax highlighting for an editor
- incrementally reparse edited source code

## When to choose
- you need fast, error-tolerant parsing of many programming languages from Python
- you want to query code with Tree-sitter's pattern query syntax
- you're building tooling like highlighters, linters, or refactoring tools

## When to avoid
- you need a full compiler frontend with semantic analysis or type information
- you only need to parse Python itself and prefer the stdlib ast module
- you need a pure-Python solution without native extensions

## Facets
- artifact type: library
- maturity: active
- function: parser, developer-tools
- domain: parsers, programming-languages, developer-tools
- platform: python, cross-platform
- tags: tree-sitter, syntax-tree, incremental-parsing, code-analysis, bindings

## Member repositories
- tree-sitter/py-tree-sitter (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:52.500343+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:33:35.341990+00:00, confidence not recorded.
  - readme: https://github.com/tree-sitter/py-tree-sitter (fetched 2026-08-28T04:04:52.500343+00:00, sha 56c030477140)
  - homepage: https://tree-sitter.github.io/py-tree-sitter/ (fetched 2026-08-29T11:39:20.396889+00:00, sha 74a745d78649)
- Data as of 2026-08-30T08:39:29.467469+00:00.
