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

Uploaded Source

Built Distribution

requirements_parser-0.3.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file requirements-parser-0.3.1.tar.gz.

File metadata

  • Download URL: requirements-parser-0.3.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for requirements-parser-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3852277618e653dd1d8fa4129e59b4338358dffafeb3d5106e9f88504db9c460
MD5 f7a59621086cea9e580bcd7d77803e00
BLAKE2b-256 c09ed0f4e67b5e7f6bf250936e84e8a6287dabbb1d6a0d5b713f7081b02a2c04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: requirements_parser-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for requirements_parser-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb9458bf5544af9a141eb170dd91e03564b7a78eb36b14437a73b6f38a96ab23
MD5 e8e3edd677739d43831565df3cfea560
BLAKE2b-256 65c525d5baf4a5e508fab535f09ff39e883740aa1b7a385652ca2207a96138c2

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