Skip to main content

Parses Pip requirement files

Project description

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.

Installation

pip install 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)
  • version control URIs
  • egg hashes and subdirectories (#egg=django-haystack&subdirectory=setup)
  • extras (DocParser[PDF])
  • URLs

Documentation

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for requirements-parser, version 0.2.0
Filename, size & hash File type Python version Upload date
requirements_parser-0.2.0-py2-none-any.whl (8.1 kB) View hashes Wheel py2
requirements-parser-0.2.0.tar.gz (6.3 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page