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.5.0.tar.gz
(11.5 kB
view hashes)
Built Distribution
Close
Hashes for requirements-parser-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3336f3a3ae23e06d3f0f88595e4052396e3adf91688787f637e5d2ca1a904069 |
|
MD5 | 08ffd99214e18e63ac84c9233f47e671 |
|
BLAKE2b-256 | c2f976106e710015f0f8da37bff8db378ced99ae2553cc4b1cffb0aef87dc4ac |
Close
Hashes for requirements_parser-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7fcdcd04f2049e73a9fb150d8a0f9d51ce4108f5f7cbeac74c484e17b12bcd9 |
|
MD5 | df0778b3d5a113ce6c645306fadd3267 |
|
BLAKE2b-256 | f889612e3b326d87780dc1daf39af7696634f969838213cddae4f553f75d04ae |