Skip to main content

This is a small Python module for parsing Pip requirement files.

Project description

Requirements Parser

shield_pypi-version shield_rtfd shield_gh-workflow-test shield_license


This is a small Python module for parsing Pip requirement files.

The goal is to parse everything in the Pip requirement file format spec.

Installation

pip install requirements-parser

or

poetry add requirements-parser

Examples

requirements-parser can parse a file-like object or a text string.

>>> import requirements
>>> with open('requirements.txt', 'r') as fd:
...     for req in requirements.parse(fd):
...         print(req.name, req.specs)
Django [('>=', '1.11'), ('<', '1.12')]
six [('==', '1.10.0')]

It can handle most (if not all) of the options in requirement files that do not involve traversing the local filesystem. These include:

  • editables (-e git+https://github.com/toastdriven/pyelasticsearch.git]{.title-ref})
  • version control URIs
  • egg hashes and subdirectories ([\#egg=django-haystack&subdirectory=setup]{.title-ref})
  • extras ([DocParser[PDF]]{.title-ref})
  • URLs

Documentation

View the documentation here.

Python Support

We endeavour to support all functionality for all current actively supported Python versions. However, some features may not be possible/present in older Python versions due to their lack of support.

Changelog

See our CHANGELOG.

Contributing

Feel free to open issues, bugreports or pull requests.
See the CONTRIBUTING file for details.

Copyright & License

requirements-parser was originally written by @davidfischer and is now maintained by @madpah. See Authors for full details.

Permission to modify and redistribute is granted under the terms of the Apache 2.0 license.

See the LICENSE file for the full license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

requirements_parser-0.13.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

requirements_parser-0.13.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file requirements_parser-0.13.0.tar.gz.

File metadata

  • Download URL: requirements_parser-0.13.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for requirements_parser-0.13.0.tar.gz
Algorithm Hash digest
SHA256 0843119ca2cb2331de4eb31b10d70462e39ace698fd660a915c247d2301a4418
MD5 5e767d272998ea960d929e2e30bb37a2
BLAKE2b-256 9596fb6dbfebb524d5601d359a47c78fe7ba1eef90fc4096404aa60c9a906fbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for requirements_parser-0.13.0.tar.gz:

Publisher: deploy.yml on madpah/requirements-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file requirements_parser-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for requirements_parser-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b3173faecf19ec5501971b7222d38f04cb45bb9d87d0ad629ca71e2e62ded14
MD5 dd81264b652366527381fe9254e82ee2
BLAKE2b-256 bd6050fbb6ffb35f733654466f1a90d162bcbea358adc3b0871339254fbc37b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for requirements_parser-0.13.0-py3-none-any.whl:

Publisher: deploy.yml on madpah/requirements-parser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page