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
For more details and examples, the documentation is available at: http://requirements-parser.readthedocs.io.
Change Log
Change log is available on GitHub here
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
requirements_parser-0.9.0.tar.gz
(22.0 kB
view hashes)
Built Distribution
Close
Hashes for requirements_parser-0.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 588f587ab76732d59df4c64bd81f1b4a4f1aaaa9b3eb7ad4f5890685446f03e8 |
|
MD5 | f7824ef211e35209a650c87f69a0e58c |
|
BLAKE2b-256 | db83396292f31f8a8ef806bb44e8a50e087f84287b670390a9d9a8d3d34f7752 |
Close
Hashes for requirements_parser-0.9.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40298fd2bb423798fc52ca4550adf1944d75c998fd2316b5b6959842dbc70a32 |
|
MD5 | 85a9effbde37a1bed90a19de2960dcbd |
|
BLAKE2b-256 | 2d2ed83d239cbf8a18f9400de46b9204c2fa8899f9347e771009aafb27858def |