Requirements Parser
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.
Metadata
Release files for requirements-parser 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| requirements_parser-0.13.1.tar.gz | 22.8 kB | With provenance | Details for requirements_parser-0.13.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| requirements_parser-0.13.1-py3-none-any.whl | Python 3 | none | any | Details for requirements_parser-0.13.1-py3-none-any.whl |
Total release size: 37.7 kB
Release files / requirements_parser-0.13.1.tar.gz
| Download URL | requirements_parser-0.13.1.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78811383b2089b6c5197a1431bc2c12ff950245edca39a23eea3460782038dd3
|
|
BLAKE2b-256 checksum How to use checksums |
891a5f3c22d38bf1d87d1f4a961489d9eba35c4370a21395562d94410cdd0e73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency logRelease files / requirements_parser-0.13.1-py3-none-any.whl
| Download URL | requirements_parser-0.13.1-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e385663eb32589d16e5b22bb6e5251a57908e73803ffff438b53cd6ea2056e0
|
|
BLAKE2b-256 checksum How to use checksums |
bbf915b44d5e4401b0013bbcefe3c09d7bfddcce28cc3d41b1d3077bcedf5b1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency logSecurity for requirements-parser 0.13.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for requirements_parser-0.13.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.