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.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requirements_parser-0.13.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for requirements_parser-0.13.1.tar.gz
Algorithm Hash digest
SHA256 78811383b2089b6c5197a1431bc2c12ff950245edca39a23eea3460782038dd3
MD5 19e92d9083e6caf58c541a55a528f52c
BLAKE2b-256 891a5f3c22d38bf1d87d1f4a961489d9eba35c4370a21395562d94410cdd0e73

See more details on using hashes here.

Provenance

The following attestation bundles were made for requirements_parser-0.13.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for requirements_parser-0.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6e385663eb32589d16e5b22bb6e5251a57908e73803ffff438b53cd6ea2056e0
MD5 db404b1686f41d4c44e4ec585f88bbb6
BLAKE2b-256 bbf915b44d5e4401b0013bbcefe3c09d7bfddcce28cc3d41b1d3077bcedf5b1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for requirements_parser-0.13.1-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page