Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-sitter-builds

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter-builds

Python bindings to the Tree-sitter parsing library

  • 2023.3.12
  • Source
  • PyPI
  • Socket score

Maintainers
1

py-tree-sitter-builds

The py-tree-sitter project (not to be confused with tree-sitter-python) provides Python bindings for the awesome tree-sitter parsing library. The documentation of py-tree-sitter says that you need to have a C compiler installed to use it, but installing a C compiler can be highly non-trivial depending on which operating system you have. It's also a huge dependency for what is otherwise a small and simple parsing library.

This project lets you use py-tree-sitter without a C compiler by providing binary wheels that were built using a C compiler, but don't require a C compiler to be installed. The wheels contain:

  • the tree_sitter module from py-tree-sitter v0.20.1
  • the tree_sitter_languages module from py-tree-sitter-languages v1.5.0

Installation

$ pip install tree-sitter-builds

After installing, import tree_sitter and import tree_sitter_languages should work. For documentation, see the documentation of:

How does it work?

Read .github/workflows/build.yml to see how GitHub actions builds the wheels. Here are the steps, at a high level:

  • Download py-tree-sitter v0.20.1 and py-tree-sitter-languages v1.5.0 from GitHub (these are the latest released versions at the time of writing this)
  • Move downloaded files to the correct places, so that the resulting wheels will contain both tree_sitter and tree_sitter_languages
  • Apply patches to the tests of tree_sitter and tree_sitter_languages so that they work here
  • Invoke cibuildwheel with the same configuration as py-tree-sitter-languages uses
  • Once the above steps have ran on Windows, MacOS and Linux, upload the wheels to PyPI

License

The wheels consist of various parts licensed under MIT and Apache 2.0 licenses:

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc