A Pip requirements file parser. This project is actively seeking maintainers.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Requirements Parser

https://travis-ci.org/davidfischer/requirements-parser.svg?branch=master https://coveralls.io/repos/github/davidfischer/requirements-parser/badge.svg?branch=master Documentation Status

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


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:


For more details and examples, the documentation is available at: http://requirements-parser.readthedocs.io.