Skip to main content

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

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requirements_parser-0.4.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for requirements-parser-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e5977e78d51ba23729a93222a7332dc37b93e32676005aa35ef893dd56773059
MD5 f8faf209e8ed13562dbe3bfd0a6261a1
BLAKE2b-256 a13e6c48bcaa190c99a41c234368b75c4df162fe25e6f5911ef6516fe012c454

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for requirements_parser-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c80268339f269b49b3047e640f057a95935ee8b07cecb01739af415d50aef08
MD5 3c9ba06d585165b0bf7028d0a84155af
BLAKE2b-256 8bbe68965f1538feb5894d34cc5bfddb0102264838f991edf1946757798f5898

See more details on using hashes here.

Release history Release notifications | RSS feed

0.13.1

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

This release

0.4.0 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

1 file

0.0.6

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page