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.6.0.tar.gz
(11.6 kB
view hashes)
Built Distribution
Close
Hashes for requirements_parser-0.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f45dd1a54c1ed87d4b713015da0899669fcc19b4a31d65b892db5dc7bd64fd3b |
|
MD5 | a7fe2674ea11096262508b6e69bd7b9b |
|
BLAKE2b-256 | 61209d4c6be6cdfda41471d9ea51d18c881443a95d5af0ea190d52fbad3a6e49 |
Close
Hashes for requirements_parser-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53c82d0a7d71c3abcf700bd3332bd3ee11804c706be4145b898660afbeb6fb9e |
|
MD5 | 7ca1e2827f6b1413f7eb03dc902ab00b |
|
BLAKE2b-256 | 818b5a0e4394fcb49e13ff646ea8266079976ccf17c0d59081666069f7f9e5c1 |