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.


pip install requirements-parser


poetry add requirements-parser


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.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+]{.title-ref})
  • version control URIs
  • egg hashes and subdirectories ([\#egg=django-haystack&subdirectory=setup]{.title-ref})
  • extras ([DocParser[PDF]]{.title-ref})
  • URLs


For more details and examples, the documentation is available at:

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.5.0.tar.gz (11.5 kB view hashes)

Uploaded source

Built Distribution

requirements_parser-0.5.0-py3-none-any.whl (18.8 kB view hashes)

Uploaded py3

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