Packages
tree_sitter_language_pack
1.19.1
1.20.0
1.19.1
1.19.0
1.18.0
1.17.0
1.16.2
1.16.1
1.15.12
1.15.8
1.15.7
1.14.3
1.14.2
1.14.1
1.14.0
1.13.7
1.13.6
1.13.5
1.13.4
1.13.3
1.13.2
1.13.1
1.13.0
1.12.5
1.12.4
1.12.3
1.12.2
1.12.1
1.12.0
1.11.1
1.11.0
1.11.0-rc.2
1.10.9
1.10.8
1.10.7
1.10.6
1.10.3
1.10.2
1.10.1
1.9.1
1.9.0
1.9.0-rc.55
1.9.0-rc.54
1.9.0-rc.53
1.9.0-rc.52
1.9.0-rc.51
1.9.0-rc.50
1.9.0-rc.49
1.9.0-rc.43
1.9.0-rc.41
1.9.0-rc.40
1.9.0-rc.39
1.9.0-rc.38
1.9.0-rc.36
1.9.0-rc.33
1.9.0-rc.32
1.9.0-rc.30
1.9.0-rc.28
1.9.0-rc.27
1.9.0-rc.26
1.9.0-rc.25
1.9.0-rc.24
1.9.0-rc.23
1.9.0-rc.22
1.9.0-rc.21
1.9.0-rc.20
1.9.0-rc.19
1.9.0-rc.17
1.9.0-rc.16
1.9.0-rc.15
1.9.0-rc.14
1.9.0-rc.13
1.9.0-rc.12
1.9.0-rc.11
1.9.0-rc.9
1.9.0-rc.8
1.9.0-rc.7
1.9.0-rc.6
1.8.1
1.8.0
1.8.0-rc.44
1.8.0-rc.43
1.8.0-rc.42
1.8.0-rc.41
1.8.0-rc.40
1.8.0-rc.39
1.8.0-rc.38
1.8.0-rc.37
1.8.0-rc.26
1.8.0-rc.24
1.8.0-rc.23
1.8.0-rc.22
1.6.2
1.6.1
1.6.0
1.5.0
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.1.1
1.1.0
1.0.0
1.0.0-rc.12
1.0.0-rc.11
1.0.0-rc.10
1.0.0-rc.9
1.0.0-rc.8
1.0.0-rc.7
1.0.0-rc.6
1.0.0-rc.5
1.0.0-rc.4
Pre-compiled tree-sitter grammars for 371 programming languages
Current section
Files
Jump to
Current section
Files
tree_sitter_language_pack
README.md
README.md
<!-- This file is auto-generated by alef — DO NOT EDIT. -->
<!-- alef:hash:de1c983809b617daacfb72e3dd3c30f986480d89dacfd9b77851210a3c5ff3d9 -->
<!-- To regenerate: alef readme -->
<!-- To verify freshness: alef verify -->
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-dark.svg">
<img alt="Xberg" width="420" src="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-light.svg">
</picture>
</p>
# Elixir
<div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0">
<a href="https://github.com/xberg-io/alef">
<img src="https://img.shields.io/badge/built%20with-alef%20%D7%90-007ec6" alt="Built with alef" />
</a>
<!-- 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/@xberg-io/tree-sitter-language-pack">
<img
src="https://img.shields.io/npm/v/@xberg-io/tree-sitter-language-pack?label=Node.js&color=007ec6"
alt="Node.js"
/>
</a>
<a href="https://www.npmjs.com/package/@xberg-io/tree-sitter-language-pack-wasm">
<img
src="https://img.shields.io/npm/v/@xberg-io/tree-sitter-language-pack-wasm?label=WASM&color=007ec6"
alt="WASM"
/>
</a>
<a href="https://central.sonatype.com/artifact/io.xberg.treesitterlanguagepack/tree-sitter-language-pack">
<img
src="https://img.shields.io/maven-central/v/io.xberg.treesitterlanguagepack/tree-sitter-language-pack?label=Java&color=007ec6"
alt="Java"
/>
</a>
<a href="https://pkg.go.dev/github.com/xberg-io/tree-sitter-language-pack/packages/go">
<img
src="https://img.shields.io/github/v/tag/xberg-io/tree-sitter-language-pack?label=Go&color=007ec6"
alt="Go"
/>
</a>
<a href="https://www.nuget.org/packages/XbergIo.TreeSitterLanguagePack/">
<img src="https://img.shields.io/nuget/v/XbergIo.TreeSitterLanguagePack?label=C%23&color=007ec6" alt="C#" />
</a>
<a href="https://packagist.org/packages/xberg-io/tree-sitter-language-pack">
<img
src="https://img.shields.io/packagist/v/xberg-io/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://pub.dev/packages/tree_sitter_language_pack">
<img src="https://img.shields.io/pub/v/tree_sitter_language_pack?label=Dart&color=007ec6" alt="Dart" />
</a>
<a href="https://central.sonatype.com/artifact/io.xberg.tslp.android/tree-sitter-language-pack-android">
<img
src="https://img.shields.io/maven-central/v/io.xberg.tslp.android/tree-sitter-language-pack-android?label=Kotlin&color=007ec6"
alt="Kotlin"
/>
</a>
<a href="https://github.com/xberg-io/tree-sitter-language-pack/tree/main/packages/swift">
<img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift" />
</a>
<a href="https://github.com/xberg-io/tree-sitter-language-pack/tree/main/packages/zig">
<img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig" />
</a>
<a href="https://github.com/xberg-io/tree-sitter-language-pack/releases">
<img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI" />
</a>
<!-- Project Info -->
<a href="https://github.com/xberg-io/tree-sitter-language-pack/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License" />
</a>
<a href="https://docs.tree-sitter-language-pack.xberg.io">
<img src="https://img.shields.io/badge/Docs-tree--sitter--language--pack-007ec6" alt="Documentation" />
</a>
</div>
<div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px">
<a href="https://discord.gg/xt9WY3GnKR">
<img
height="22"
src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white"
alt="Join Discord"
/>
</a>
</div>
Pre-compiled tree-sitter grammars for 371 programming languages with Elixir bindings via Rustler NIF.
## What This Package Provides
- **Parser access** — load a tree-sitter language parser by name without wiring individual grammar crates or packages.
- **Code intelligence primitives** — parse trees, functions, classes, imports, exports, symbols, docstrings, diagnostics, and syntax-aware chunks.
- **Shared cache model** — parsers are fetched and cached once, then reused by every call in the process.
- **Same catalog as every binding** — Rust, Python, Node.js, Go, Java, PHP, Ruby, .NET, Elixir, WASM, Dart, Kotlin Android, Swift, Zig, and C FFI use the same grammar set.
- **BEAM package** — Rustler NIF binding for parser calls inside Elixir systems.
## Installation
Add to `mix.exs`:
```elixir
defp deps do
[
{:tree_sitter_language_pack, "~> 1.19.1"}
]
end
```
## Quick Start
```elixir title="Elixir"
config_value = %TreeSitterLanguagePack.ProcessConfig{language: "python"}
result = TreeSitterLanguagePack.process("\# A comment\ndef greet(name):\n \"\"\"Say hello.\"\"\"\n return f'Hi {name}'\n\nimport os\n", config_value)
IO.inspect(result.language)
IO.inspect(result.structure)
IO.inspect(Enum.at(result.structure, 0).kind)
IO.inspect(result.imports)
IO.inspect(result.metrics.total_lines)
IO.inspect(result.metrics.error_count)
```
## Features
- **371 languages** — pre-compiled tree-sitter grammars covering every major programming language and many minor ones.
- **On-demand download + cache** — parsers fetched at first use; subsequent runs hit the local cache.
- **Code intelligence** — extract functions, classes, imports, exports, symbols, docstrings, and diagnostics with one API.
- **Syntax-aware chunking** — semantic chunks for RAG/LLM pipelines.
- **Polyglot bindings** — native APIs across 15 languages: Rust, Python, TypeScript/Node.js, Go, Java, C#, Ruby, PHP, Elixir, WebAssembly, Dart, Kotlin, Swift, Zig, and C/C++ via [alef](https://github.com/xberg-io/alef).
## Documentation
- **[Documentation](https://docs.tree-sitter-language-pack.xberg.io)** -- Full docs and API reference
- **[GitHub Repository](https://github.com/xberg-io/tree-sitter-language-pack)** -- Source, issues, and discussions
## Part of Xberg
- [Xberg](https://github.com/xberg-io/xberg) — document intelligence: text, tables, metadata from 101 formats with optional OCR.
- [Xberg Enterprise](https://github.com/xberg-io/xberg-enterprise) — managed extraction API with SDKs, dashboards, and observability.
- [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
- [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
- [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 165 providers.
- [alef](https://github.com/xberg-io/alef) — the polyglot binding generator that produces this README and all per-language bindings.
- [Discord](https://discord.gg/xt9WY3GnKR) — community, roadmap, announcements.
## Contributing
Contributions are welcome! See [CONTRIBUTING.md](https://github.com/xberg-io/tree-sitter-language-pack/blob/main/CONTRIBUTING.md) for guidelines.
Join our [Discord community](https://discord.gg/xt9WY3GnKR) for questions and discussion.
## License
MIT -- see [LICENSE](https://github.com/xberg-io/tree-sitter-language-pack/blob/main/LICENSE) for details.