Metadata-Version: 2.4
Name: tree-sitter-language-pack
Version: 1.6.3
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Typing :: Typed
License-File: LICENSE
Summary: Comprehensive collection of 305 tree-sitter language parsers with polyglot bindings
Keywords: ast,code,kreuzberg,parser,parsing,syntax,text-processing,tree-sitter
Author-email: Na'aman Hirschfeld <naaman@kreuzberg.dev>
License-Expression: MIT
Requires-Python: >=3.10.0
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: documentation, https://github.com/kreuzberg-dev/tree-sitter-language-pack#readme
Project-URL: homepage, https://github.com/kreuzberg-dev/tree-sitter-language-pack
Project-URL: issues, https://github.com/kreuzberg-dev/tree-sitter-language-pack/issues
Project-URL: repository, https://github.com/kreuzberg-dev/tree-sitter-language-pack

<!-- Generated by scripts/generate_readme.py. DO NOT EDIT. -->

# tree-sitter-language-pack

<div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0;">
  <!-- Language Bindings -->  <a href="https://crates.io/crates/tree-sitter-language-pack">
    <img src="https://img.shields.io/crates/v/tree-sitter-language-pack?label=Rust&color=007ec6" alt="Rust">
  </a>  <a href="https://pypi.org/project/tree-sitter-language-pack/">
    <img src="https://img.shields.io/pypi/v/tree-sitter-language-pack?label=Python&color=007ec6" alt="Python">
  </a>  <a href="https://www.npmjs.com/package/@kreuzberg/tree-sitter-language-pack">
    <img src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack?label=Node.js&color=007ec6" alt="Node">
  </a>  <a href="https://www.npmjs.com/package/@kreuzberg/tree-sitter-language-pack-wasm">
    <img src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack-wasm?label=WASM&color=007ec6" alt="Wasm">
  </a>  <a href="https://central.sonatype.com/artifact/dev.kreuzberg/tree-sitter-language-pack">
    <img src="https://img.shields.io/maven-central/v/dev.kreuzberg/tree-sitter-language-pack?label=Java&color=007ec6" alt="Java">
  </a>  <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/go">
    <img src="https://img.shields.io/github/v/tag/kreuzberg-dev/tree-sitter-language-pack?label=Go&color=007ec6" alt="Go">
  </a>  <a href="https://www.nuget.org/packages/TreeSitterLanguagePack">
    <img src="https://img.shields.io/nuget/v/TreeSitterLanguagePack?label=C%23&color=007ec6" alt="Csharp">
  </a>  <a href="https://packagist.org/packages/kreuzberg/tree-sitter-language-pack">
    <img src="https://img.shields.io/packagist/v/kreuzberg/tree-sitter-language-pack?label=PHP&color=007ec6" alt="Php">
  </a>  <a href="https://rubygems.org/gems/tree_sitter_language_pack">
    <img src="https://img.shields.io/gem/v/tree_sitter_language_pack?label=Ruby&color=007ec6" alt="Ruby">
  </a>  <a href="https://hex.pm/packages/tree_sitter_language_pack">
    <img src="https://img.shields.io/hexpm/v/tree_sitter_language_pack?label=Elixir&color=007ec6" alt="Elixir">
  </a>  <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/pkgs/container/tree-sitter-language-pack">
    <img src="https://img.shields.io/badge/Docker-007ec6?logo=docker&logoColor=white" alt="Docker">
  </a>  <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/crates/ts-pack-ffi">
    <img src="https://img.shields.io/badge/C-FFI-007ec6" alt="Ffi">
  </a>
  <!-- Project Info -->
  <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/actions">
    <img src="https://img.shields.io/github/actions/workflow/status/kreuzberg-dev/tree-sitter-language-pack/ci-rust.yaml?branch=main&label=CI&color=007ec6" alt="CI">
  </a>
  <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/License-MIT-007ec6.svg" alt="License">
  </a>
  <a href="https://github.com/kreuzberg-dev/homebrew-tap">
    <img src="https://img.shields.io/badge/homebrew-ts--pack-007ec6?logo=homebrew" alt="Homebrew">
  </a>
  <a href="https://docs.tree-sitter-language-pack.kreuzberg.dev">
    <img src="https://img.shields.io/badge/docs-kreuzberg.dev-007ec6" alt="Docs">
  </a>
</div>

<div align="center">
  <img width="3384" height="573" alt="Banner" src="https://github.com/user-attachments/assets/478a83da-237b-446b-b3a8-e564c13e00a8" />
</div>

<div align="center">
  <a href="https://discord.gg/xt9WY3GnKR">
    <img height="22" src="https://img.shields.io/badge/Discord-Join%20our%20community-7289da?logo=discord&logoColor=white" alt="Discord">
  </a>
</div>

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

## Overview

**tree-sitter-language-pack** bundles 305+ tree-sitter language parsers into a single package with native bindings for multiple programming languages. Ship syntax analysis in your application without managing individual parser dependencies.

## Architecture

```text
tree-sitter-language-pack/
├── crates/
│   ├── ts-pack-core/       # Rust core library
│   ├── ts-pack-python/     # Python (maturin/PyO3) bindings
│   ├── ts-pack-node/       # Node.js (NAPI-RS) bindings
│   ├── ts-pack-java/       # Java (Panama FFI) bindings
│   ├── ts-pack-elixir/     # Elixir (Rustler NIF) bindings
│   ├── ts-pack-ffi/        # C-compatible FFI library
│   └── ts-pack-cli/        # CLI tool
├── packages/
│   └── go/v1/              # Go (cgo) bindings
├── grammars/               # Tree-sitter grammar sources
└── scripts/                # Build and maintenance scripts
```

## Quick Start

### Rust

```sh
cargo add ts-pack-core
```

See [Rust README](crates/ts-pack-core/README.md) for full documentation.

### Python

```sh
pip install tree-sitter-language-pack
```

```sh
uv add tree-sitter-language-pack
```

See [Python README](crates/ts-pack-python/README.md) for full documentation.

### Node.js

```sh
npm install @kreuzberg/tree-sitter-language-pack
```

```sh
pnpm add @kreuzberg/tree-sitter-language-pack
```

```sh
yarn add @kreuzberg/tree-sitter-language-pack
```

See [Node.js README](crates/ts-pack-node/README.md) for full documentation.

### Go

```sh
go get github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go
```

See [Go README](packages/go/README.md) for full documentation.

### Java

```xml
<dependency>
  <groupId>dev.kreuzberg</groupId>
  <artifactId>tree-sitter-language-pack</artifactId>
  <version>1.6.2</version>
</dependency>
```

```groovy
implementation("dev.kreuzberg:tree-sitter-language-pack:1.6.2")
```

See [Java README](crates/ts-pack-java/README.md) for full documentation.

### Elixir

```elixir
{:tree_sitter_language_pack, "~> 1.0"}
```

See [Elixir README](crates/ts-pack-elixir/README.md) for full documentation.

### Ruby

```sh
gem install tree_sitter_language_pack
```

See [Ruby README](crates/ts-pack-ruby/README.md) for full documentation.

### WebAssembly

```sh
npm install @kreuzberg/tree-sitter-language-pack-wasm
```

```sh
pnpm add @kreuzberg/tree-sitter-language-pack-wasm
```

```sh
yarn add @kreuzberg/tree-sitter-language-pack-wasm
```

See [WebAssembly README](crates/ts-pack-wasm/README.md) for full documentation.

### PHP

```sh
composer require kreuzberg/tree-sitter-language-pack
```

See [PHP README](crates/ts-pack-php/README.md) for full documentation.

### .NET (C#)

```sh
dotnet add package TreeSitterLanguagePack
```

See [.NET (C#) README](packages/csharp/TreeSitterLanguagePack/README.md) for full documentation.

### C/C++ (FFI)

Build from source as part of this workspace.

See [C/C++ (FFI) README](crates/ts-pack-ffi/README.md) for full documentation.

### CLI

```sh
cargo install ts-pack
```

See [CLI README](crates/ts-pack-cli/README.md) for full documentation.

## Core API

All bindings expose a unified `process()` function for extracting structured intelligence from source code:

| Language | Function |
| -------- | -------- |
| Rust | `ts_pack_core::process(source, &config)` |
| Python | `process(source, ProcessConfig(...))` |
| Node.js | `process(source, { language: '...' })` |
| Go | `registry.Process(source, config)` |
| Java | `registry.process(source, configJson)` |
| Ruby | `TreeSitterLanguagePack.process(source, configJson)` |
| Elixir | `TreeSitterLanguagePack.process(source, configJson)` |
| WASM | `process(source, { language: '...' })` |
| C FFI | `ts_pack_process(registry, source, len, configJson)` |

The `process()` function returns structured analysis including functions, classes, imports, comments, and optionally chunked source segments.

## Features

| Feature | Description |
| --- | --- |
| **305+ Languages** | Pre-compiled parsers for 305+ programming languages |
| **On-Demand Downloads** | Parsers are downloaded on-demand and cached locally for fast reuse |
| **Selective Installation** | Download only the languages you need; unused parsers never downloaded |
| **Polyglot Bindings** | Native bindings for Rust, Python, Node.js, Go, Java, Elixir, and C/C++ |
| **Automatic Caching** | Downloaded parsers cached in platform-specific directories for offline use |
| **CLI Tool** | `ts-pack download` to pre-download parsers for offline/CI/Docker use |

## Supported Languages

This pack includes 305+ languages. See the [full language list](docs/supported-languages.md) for all supported grammars with extensions and repository links.

## Package READMEs

- [Rust](crates/ts-pack-core/README.md) -- Rust core library providing access to 305 tree-sitter parsers with on-demand download and caching support.
- [Python](crates/ts-pack-python/README.md) -- Python bindings for tree-sitter-language-pack, providing access to 305 pre-compiled tree-sitter parsers with on-demand downloads.
- [Node.js](crates/ts-pack-node/README.md) -- Node.js NAPI bindings for tree-sitter-language-pack with on-demand parser downloads.
- [Go](packages/go/README.md) -- Go bindings for tree-sitter-language-pack with on-demand parser caching.
- [Java](crates/ts-pack-java/README.md) -- Java bindings for tree-sitter-language-pack with on-demand parser downloads (JDK 22+).
- [Elixir](crates/ts-pack-elixir/README.md) -- Elixir bindings for tree-sitter-language-pack with on-demand parser downloads.
- [Ruby](crates/ts-pack-ruby/README.md) -- Ruby bindings for tree-sitter-language-pack with on-demand parser downloads.
- [WebAssembly](crates/ts-pack-wasm/README.md) -- WebAssembly bindings for tree-sitter-language-pack. Includes a curated subset of 30 languages optimized for browser and edge runtimes. For all 305 languages, use native bindings (Python, Node.js, etc.).
- [PHP](crates/ts-pack-php/README.md) -- PHP extension via ext-php-rs with on-demand parser downloads.
- [.NET (C#)](packages/csharp/TreeSitterLanguagePack/README.md) -- .NET P/Invoke bindings with on-demand parser downloads.
- [C/C++ (FFI)](crates/ts-pack-ffi/README.md) -- C-compatible FFI bindings for tree-sitter-language-pack. Use from any language with C interop.
- [CLI](crates/ts-pack-cli/README.md) -- Command-line tool for managing tree-sitter language parsers with download utilities.

## Contributing

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

Join our [Discord community](https://discord.gg/xt9WY3GnKR) for questions and discussion.

## License

MIT -- see [LICENSE](LICENSE) for details.

All included tree-sitter grammars are permissively licensed (MIT, Apache-2.0, BSD, ISC, or similar). Copyleft licenses (GPL, AGPL, LGPL, MPL) are not accepted. See [CONTRIBUTING.md](CONTRIBUTING.md) for grammar inclusion criteria.

