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.4-cp38-abi3-macosx_10_9_universal2.whl (28.5 kB view details)

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

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

Uploaded CPython 3.7+ Windows x86-64

tree_sitter_requirements-0.1.4-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.4-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.4-cp38-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.4-cp38-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c21e9b0da132e3017d7939aca85ed796ca3c4053c21712522e5787741d60f62b
MD5 7fee5757f099fcfbbfbbe0d0c6ca8266
BLAKE2b-256 b92edc4a52c2e10d687682afade106f78b5dc123331085705d07edeaaae9c400

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.4-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f355af6550bee2b38def399b3e61337f275133f5c7960d44e7c8c2fc79193e2a
MD5 e6e016d4d5f85045abb4a5be2fc225d5
BLAKE2b-256 527ab1e89cd82036ab0800d76ac0e4650f4490b5292cf3927e37158283b09965

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.4-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 c48461366310f7b7206faaa7c696a1b749b06ce694021c1adbfc8ece27b1d927
MD5 3767f785a6351898eecb374636febd76
BLAKE2b-256 4597094d94ba9a251b6d646b97207d3e5091f3a174d80ad9f0694dccdba59c38

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.4-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.4-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c2ed84d8b5d436667513ca16653da3f7bf8ae579918c5b8d196aa3de3ab4dab
MD5 db6c89f5c157dc2b20712c83afb9ebea
BLAKE2b-256 e21c68e5c5f5164a36139caa0673ca0ef1a73dcceb08ab1b658f548291cb714f

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