Skip to main content

Pre-compiled tree-sitter parsers for 170+ programming languages with a unified process() API for parsing, analysis, and intelligent code chunking.

Project description

tree-sitter-language-pack — Python

Python bindings for tree-sitter-language-pack, providing access to 170+ pre-compiled tree-sitter parsers with on-demand downloads.

Installation

pip install tree-sitter-language-pack
uv add tree-sitter-language-pack

Quick Start

from tree_sitter_language_pack import init, download, get_language, get_parser, available_languages

# Optional: Pre-download specific languages for offline use
init(["python", "javascript", "rust"])

# Get a language (auto-downloads if not cached)
language = get_language("python")

# Get a pre-configured parser (auto-downloads if needed)
parser = get_parser("python")
tree = parser.parse(b"def hello(): pass")
print(tree.root_node.sexp())

# List all available languages
for lang in available_languages():
    print(lang)

from tree_sitter_language_pack import process, ProcessConfig

# Extract file intelligence (auto-downloads language if needed)
result = process("def hello(): pass", ProcessConfig(language="python"))
print(f"Functions: {len(result['structure'])}")

# Pre-download languages for offline use
download(["python", "javascript"])

# With chunking
result = process(source, ProcessConfig(language="python", chunk_max_size=1000, comments=True))
print(f"Chunks: {len(result['chunks'])}")

API Reference

Language Discovery

  • available_languages() -- list all supported language names
  • has_language(name) -- check if a language is available
  • language_count() -- total number of supported languages

Parsing

  • get_parser(name) / parse_string(source, language) -- parse source code into a syntax tree

Download API

  • init(languages) -- pre-download specific languages for offline use
  • download(languages) -- download parsers on demand

Intelligence

  • process(source, config) -- extract structured analysis (functions, classes, imports, comments, chunks) from source code

For detailed API documentation, see the Python package.

License

MIT -- see LICENSE for details.


Part of tree-sitter-language-pack -- A comprehensive collection of tree-sitter language parsers with polyglot bindings.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_language_pack-1.0.0-cp310-abi3-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ ARM64

tree_sitter_language_pack-1.0.0-cp310-abi3-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file tree_sitter_language_pack-1.0.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_language_pack-1.0.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 76423b911b100e79d3c078e21fd024d2c470db3355e7dc3a3bddc2a2007ce250
MD5 b79ed6248c600be18777dd98f78f9acf
BLAKE2b-256 7c339a9bb95d62778ec8f1e710b99a7cf829e4c8b5a4a0474791742bc4108a8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_language_pack-1.0.0-cp310-abi3-win_amd64.whl:

Publisher: publish.yaml on kreuzberg-dev/tree-sitter-language-pack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 78ba52ea0b500ba61810743fcb2678023a6850ebb09ed8214665d29fafa044b6
MD5 1f84f11b0c74e272706a62ec386d934f
BLAKE2b-256 7ed3f5db913afebd54798c7e3d12e6db7dec88e09f3c9782169ec5c0bfb137d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish.yaml on kreuzberg-dev/tree-sitter-language-pack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 53853d16a55af46c1722dbd4c9adcae11411c8c5a6c5db3968ad98bca125d9db
MD5 a13b90ba20674c2e30b1f14ebae3028b
BLAKE2b-256 1935226e0a6bd1736ec55b9e865589cf4571c43cd70e5ebe3c35e89d55035fe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_language_pack-1.0.0-cp310-abi3-manylinux_2_34_aarch64.whl:

Publisher: publish.yaml on kreuzberg-dev/tree-sitter-language-pack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tree_sitter_language_pack-1.0.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_language_pack-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02f91aeec73268a1cf1697fe7560700435ce1e076cc166c7a2bb627f4fdc2f0f
MD5 da79d2145422649830cd1b4f911ddc80
BLAKE2b-256 391468ac021fd3dd8ef7741e8a825647e068195627fbe714019114d2dc4ab028

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_sitter_language_pack-1.0.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yaml on kreuzberg-dev/tree-sitter-language-pack

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page