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

Uploaded Source

Built Distribution

requirements_parser-0.7.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file requirements_parser-0.7.0.tar.gz.

File metadata

  • Download URL: requirements_parser-0.7.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for requirements_parser-0.7.0.tar.gz
Algorithm Hash digest
SHA256 33f1b1c668fa85df8c6a638c479ac743ea8541f5d8d56011591068757ce1a201
MD5 a23506d8a7cffa78188828ae8b4fc304
BLAKE2b-256 c7d8f819c454ae8f86121a463194f8abdc714f11bc6f13b5c04378d9003caef1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for requirements_parser-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80569baa23b13cf0980fb2ceb5dc2e3b7ee05df203a26d83e3ed56c155c6597a
MD5 6f97941dffa296775e0044af00f4cbf0
BLAKE2b-256 3f651cb0f741dd6dfb6b5c2ff5b19cfdbdba54b39101d1c12951f2aa4fcba678

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