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

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

tree_sitter_requirements-0.1.2-cp37-abi3-win_amd64.whl (19.3 kB view details)

Uploaded CPython 3.7+ Windows x86-64

tree_sitter_requirements-0.1.2-cp37-abi3-musllinux_1_1_x86_64.whl (16.8 kB view details)

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

tree_sitter_requirements-0.1.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.5 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.2-cp38-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.2-cp38-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b47c95f391b25822408a51843b795115830d36456f2003e0e40fc6f6855982a2
MD5 24a9dd7945dd7f863a4bc2bed8571870
BLAKE2b-256 a9bdfd1abfcd33421c5bf30cd483eb6bf62890876ec4b2d49d0237b50816d932

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f3ba01af11a41f107a30e7cf61161ddb65ad6abefe5dac98c4ca740642443309
MD5 fb7c57fc43c8b3f64ffca40bc47c1140
BLAKE2b-256 cff10dffa0d0bc14a9474277c18888dfe96a40832f0655aaf7dd5b766c0fede7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.2-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 1785494c95d892c4ecabe92204ef7fb6ceb79b0c1c720582506fb76161648ac4
MD5 c2c0be0c864ef2a167e793d5718930e7
BLAKE2b-256 e49a899e6000abd7349879ac001853173fed83dae77151103513b9dfbdb6489b

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.2-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.2-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 297fb0adc7b2a74e0e2a6c3a00c13af36512ced7afe59a42809e424ab497ed94
MD5 1b8ced8dd35db3e955ea26b4c40d3f4a
BLAKE2b-256 026314e46be98e34887e5b59cb24783ac5486508996faf36a255f5420c28f10d

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