Skip to main content

A tree-sitter parser for requirements.txt files

Project description

A tree-sitter parser for pip requirements files.

Python package

Installation

pip install tree-sitter-requirements

Usage

import tree_sitter_requirements as requirements

with open('requirements.txt', 'r') as mf:
   # parse a requirements.txt file
   tree = requirements.parse(mf.read())
   # get the highlight groups
   hl_groups = requirements.highlights(tree)
   # run an arbitrary query
   packages = requirements.query("""
   (requirement (package) @package)
   """, tree.root_node)

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 Distributions

tree_sitter_requirements-0.1.3-cp38-abi3-macosx_10_9_universal2.whl (28.4 kB view details)

Uploaded CPython 3.8+ macOS 10.9+ universal2 (ARM64, x86-64)

tree_sitter_requirements-0.1.3-cp37-abi3-win_amd64.whl (20.6 kB view details)

Uploaded CPython 3.7+ Windows x86-64

tree_sitter_requirements-0.1.3-cp37-abi3-musllinux_1_1_x86_64.whl (18.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.1+ x86-64

tree_sitter_requirements-0.1.3-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

File details

Details for the file tree_sitter_requirements-0.1.3-cp38-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.3-cp38-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5be0bcbda8b38b07dfd942233b5d86f47594f142a7780cc7163efc30e652d72e
MD5 6b12bcf5ae007491621de61034cf150f
BLAKE2b-256 b5a72dc9947f87fd5b05a5e92c27c820396551c7da41fef2cb0fd65f281a2eea

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.3-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 72611fba33be54d3c9d92e5eb9b73439d11694ce2573801f9e329c3d5a23590f
MD5 9999bca9eca1a742ca22bf57ad29c593
BLAKE2b-256 de3456672b7065acce7c6b32b5a49c20dc89508c543c98832cf5b7d9fa44e82b

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.3-cp37-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.3-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a1598e764f0539eefd827f5ce8579f2459d5c39626d67d924d768a15c288877c
MD5 f4dd58eab6c225097d1c9b060819edcc
BLAKE2b-256 830d3401532cab7ba3a104e250f918723a1d09d5ed226ce65bd48dced2e5695c

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.3-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.3-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d667df0cb659964d0febedb449d2d18b1f5c5b5c944b6b0e3327b9ed99f49141
MD5 6c04773bf637d9ac54b8aa800f19e204
BLAKE2b-256 59aad23a6b005ebab5a446a7bd08aca1da460a89fda4f7485334b5e21617cfcf

See more details on using hashes here.

Provenance

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