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

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

tree_sitter_requirements-0.1.0-cp37-abi3-win_amd64.whl (18.7 kB view details)

Uploaded CPython 3.7+ Windows x86-64

tree_sitter_requirements-0.1.0-cp37-abi3-musllinux_1_1_x86_64.whl (16.3 kB view details)

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

tree_sitter_requirements-0.1.0-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.0 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.0-cp38-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.0-cp38-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 5a5be9e0498d08fd775a84ceed7ef3f013aa5663f6c15ebe022cb95f9a31cf66
MD5 9fa6ae121d98d7c9ad85751747aad82b
BLAKE2b-256 189edca5318f562a1de0cd9d3dbba9e068c3c9e94c72271e7501aa49a20ac812

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d6b33e460893e017451a9131a4dfc8335e0d0665a980a86e1c4049f075f0040b
MD5 cdfd1a26e85b487865b462c39e032769
BLAKE2b-256 b4744dc52ed9dd8a94124d47ca5f74b991499361e6e80f72d4dbbaf121e8e8a1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.0-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 11c98fad8d03b983f47adc1175148c766a925a553c828dc5dda463a17befa492
MD5 278c31bdd23202ea46e79ef29caa439b
BLAKE2b-256 ba82aaae8d0bca1728f04d599606d50e461f695e510d202e98c3f86e2461baee

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.0-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.0-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b9694be841f09835451547be5cc62222e0e5568bf39662263c9488c4cc3743a
MD5 7f97a74948d8660c279c2f7616ca6735
BLAKE2b-256 e204ec06df7cf12ae6808db5cb2762d64efc7e9a9098055f58c93056fbbd2064

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