Skip to main content

Generate typed Python bindings for tree-sitter parsers

Project description

🔧 python-tree-sitter-types

Package Version

This repository contains a python typed interface generation tool for tree-sitter grammars.

Installation

Installation is simple with pip:

pip install tree-sitter-types

Usage

This library provides two functions.

As a CLI you can use it to generate the types for your tree-sitter grammar:

python-tree-sitter-types node-types.json your_language_types.py

You can then package these and distribute them on pypi, following tree-sitters naming standard tree-sitter-yourlang.

As a library it provides the functions to install tree-sitter parsers and to load them into python.

Why is this useful?

Tree-sitter is a great library for parsing source code. It is fast, easy to use and has a lot of great features. However, it is written in C and does not provide a typed interface for python. This makes writing tools on top of it a bit cumbersome.

With this library you'll be able to use pythons types for your advantage, leveraging autocompletion for fast coding, types for correctness, and nice features like matching.

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 Distribution

tree_sitter_types-0.0.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file tree_sitter_types-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tree_sitter_types-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aee9803f34e33ba4c2724c62192519630a2457f37d3c4ca7f127823c8dbc8dd5
MD5 c92489ead3a5b472beed67fa855b625e
BLAKE2b-256 7fc7c110977356c3b342f8199c6877ad3d87edcd5dd635e4e575e1dde72b4b49

See more details on using hashes here.

Supported by

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