Skip to main content

This is a small Python module for parsing Pip requirement files.

Project description

Requirements Parser

shield_pypi-version shield_rtfd shield_gh-workflow-test shield_license


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


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.11.0.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

requirements_parser-0.11.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file requirements_parser-0.11.0.tar.gz.

File metadata

  • Download URL: requirements_parser-0.11.0.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for requirements_parser-0.11.0.tar.gz
Algorithm Hash digest
SHA256 35f36dc969d14830bf459803da84f314dc3d17c802592e9e970f63d0359e5920
MD5 ea33d88ff4ca38dfe91b986dd06eaecf
BLAKE2b-256 057080ed53ebd21853855aad552d4ed6c4934df62cd32fe9a3669fcdef59429c

See more details on using hashes here.

Provenance

File details

Details for the file requirements_parser-0.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for requirements_parser-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50379eb50311834386c2568263ae5225d7b9d0867fb55cf4ecc93959de2c2684
MD5 ed1fa2c23e36c28d0a405263c11c6a64
BLAKE2b-256 8833190393a7d36872e237cbc99e6c44d9a078a1ba7b406462fe6eafd5a28e04

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page