This is a small Python module for parsing Pip requirement files.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0843119ca2cb2331de4eb31b10d70462e39ace698fd660a915c247d2301a4418
|
|
| MD5 |
5e767d272998ea960d929e2e30bb37a2
|
|
| BLAKE2b-256 |
9596fb6dbfebb524d5601d359a47c78fe7ba1eef90fc4096404aa60c9a906fbb
|
Provenance
The following attestation bundles were made for requirements_parser-0.13.0.tar.gz:
Publisher:
deploy.yml on madpah/requirements-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
requirements_parser-0.13.0.tar.gz -
Subject digest:
0843119ca2cb2331de4eb31b10d70462e39ace698fd660a915c247d2301a4418 - Sigstore transparency entry: 216368082
- Sigstore integration time:
-
Permalink:
madpah/requirements-parser@80d296e22a0ff30e0f17cb1feaf12ea2ea76d5e5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/madpah
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@80d296e22a0ff30e0f17cb1feaf12ea2ea76d5e5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file requirements_parser-0.13.0-py3-none-any.whl.
File metadata
- Download URL: requirements_parser-0.13.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b3173faecf19ec5501971b7222d38f04cb45bb9d87d0ad629ca71e2e62ded14
|
|
| MD5 |
dd81264b652366527381fe9254e82ee2
|
|
| BLAKE2b-256 |
bd6050fbb6ffb35f733654466f1a90d162bcbea358adc3b0871339254fbc37b2
|
Provenance
The following attestation bundles were made for requirements_parser-0.13.0-py3-none-any.whl:
Publisher:
deploy.yml on madpah/requirements-parser
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
requirements_parser-0.13.0-py3-none-any.whl -
Subject digest:
2b3173faecf19ec5501971b7222d38f04cb45bb9d87d0ad629ca71e2e62ded14 - Sigstore transparency entry: 216368083
- Sigstore integration time:
-
Permalink:
madpah/requirements-parser@80d296e22a0ff30e0f17cb1feaf12ea2ea76d5e5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/madpah
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@80d296e22a0ff30e0f17cb1feaf12ea2ea76d5e5 -
Trigger Event:
push
-
Statement type: