Skip to content

Goldziher/tree-sitter-language-pack

Repository files navigation

Tree Sitter Language Pack

PyPI Python Versions License Downloads

This package bundles a comprehensive collection of tree-sitter languages as both source distribution and pre-built wheels.

Installation

pip install tree-sitter-language-pack

Important Notes

  • This package started life as a maintained and updated fork of tree-sitter-languages by Grant Jenks, and it incorporates code contributed by ObserverOfTime (see this PR).
  • This package is MIT licensed and the original package of which this is a fork has an Apache 2.0 License. Both licenses are available in the LICENSE file.
  • All languages bundled by this package are licensed under permissive open-source licenses (MIT, Apache 2.0 etc.) only - no GPL licensed languages are included.

Features

  • 165+ Languages: Support for all major programming languages and many domain-specific languages
  • Pre-built Wheels: Easy installation with no compilation required
  • Type-Safe: Full typing support for better IDE integration and code safety
  • Zero GPL Dependencies: All bundled languages use permissive licenses (MIT, Apache 2.0, etc.)

Usage

This library exposes three functions: get_binding, get_language, and get_parser.

from tree_sitter_language_pack import get_binding, get_language, get_parser

python_binding = get_binding("python")  # this is a pycapsule object pointing to the C binding
python_lang = get_language("python")  # this is an instance of tree_sitter.Language
python_parser = get_parser("python")  # this is an instance of tree_sitter.Parser

See the list of available languages below to get the name of the language you want to use.

Available Languages

Each language below is identified by the key used to retrieve it from the get_language and get_parser functions.

Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Setting up your development environment
  • Adding new languages
  • Running tests
  • Submitting pull requests

License

This project is licensed under the MIT OR Apache-2.0 license. See the LICENSE file for details.

Acknowledgments

This package started as a maintained fork of tree-sitter-languages by Grant Jenks.