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

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

tree_sitter_requirements-0.1.1-cp37-abi3-win_amd64.whl (18.8 kB view details)

Uploaded CPython 3.7+ Windows x86-64

tree_sitter_requirements-0.1.1-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.1-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.1-cp38-abi3-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.1-cp38-abi3-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3acabbc389d5b914bdeea6ba929b32c15b6fa3bcf5eae07d87bc54cb8e04db5e
MD5 63a59a9aa1d14c118dafc184f55ed8bb
BLAKE2b-256 5cb5854685a59975f2d1a6baaff8e2440e3adc34209b44f2c3ca4f47b6c2b575

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 44ea6f035de30fa0851c8b1f0be2430e199b2772c40073412f61cbc39e31b86e
MD5 655cdcfa830630a93c57b2e67b4672bc
BLAKE2b-256 6abc65f429566b2f5e502f3e61e49b4745098a9e9db20ffd8b21465b84ed65c6

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for tree_sitter_requirements-0.1.1-cp37-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a880577909ae30f193d1a84b11ffb5c0cf2a4e31cf6ec69a33dcd6f104f23826
MD5 5a1308d09ed8fb1663d1706521e1ad12
BLAKE2b-256 dee1436587af18651404366d2e511e2ad94f54496f2af468601496e5fde4f991

See more details on using hashes here.

Provenance

File details

Details for the file tree_sitter_requirements-0.1.1-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.1-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0697dc9290417196746cbfa961701491fbe54e4032f69b81f3142b2c4a5153bf
MD5 e95f323c1a3331dc921af181600b498e
BLAKE2b-256 13f4363619dc3f695d362a7d48c481623fe8e4af04f58d5f977c4c9d9bcee5fb

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