Skip to main content

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

Project description

Requirements Parser

Python CI Documentation Status 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

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


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

Uploaded Source

Built Distribution

requirements_parser-0.8.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: requirements_parser-0.8.0.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for requirements_parser-0.8.0.tar.gz
Algorithm Hash digest
SHA256 005a988a15911f700d982869e31b97c2e9681db69d20e701cd4c67c61042d8cf
MD5 f32f82b1146739cdd71a5701ab68d4d5
BLAKE2b-256 7d221010eb5eb7917c18651b6199493972e4e1adbd83e5057909a219ffe53db8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requirements_parser-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3bbd9ad1f56749d51aa22f70b965beb7a190fab711fde36cb23d3413acb6881
MD5 6084a6714410afc45429be93fd12466c
BLAKE2b-256 2a7c03bce1c6fead9c44b5f2fa4e257e710e2fe1cae64db25609b82bcbc8517b

See more details on using hashes here.

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