Skip to main content

A tool for converting between pip-style and pipfile requirements.

Project description

RequirementsLib: Requirement Management Library for Pip and Pipenv
===================================================================

Installation
*************

Install from `PyPI`_:

::

$ pipenv install --pre requirementslib

Install from `Github`_:

::

$ pipenv install -e git+https://github.com/techalchemy/requirementslib.git#egg=requirementslib


.. _PyPI: https://www.pypi.org/projects/requirementslib
.. _Github: https://github.com/techalchemy/requirementslib


.. _`Summary`:

Summary
********

RequirementsLib provides a simple layer for building and interacting with
requirements in both the `Pipfile <https://github.com/pypa/pipfile/>`_ format
and the `requirements.txt <https://github.com/pypa/pip/>`_ format. This library
was originally built for converting between these formats in `Pipenv <https://github.com/pypa/pipenv>`_.

.. _`Usage`:

Usage
******

Import the library and create a requirement object from *requirements.txt* format:

::

>>> from requirementslib import Requirement
>>> r = Requirement.from_line('-e git+https://github.com/pypa/pipenv.git@master#egg=pipenv')
>>> print(r)
Requirement(name='pipenv', vcs='git', req=VCSRequirement(editable=True, uri='git+https://github.com/pypa/pipenv.git', path=None, vcs='git', ref='master', subdirectory=None, name='pipenv', link=<Link git+https://github.com/pypa/pipenv.git@master#egg=pipenv>, req=<Requirement: "-e git+https://github.com/pypa/pipenv.git@master#egg=pipenv">), markers=None, specifiers=None, index=None, editable=True, hashes=[], extras=[])

>>> r.as_pipfile()
{'pipenv': {'editable': True, 'ref': 'master', 'git': 'https://github.com/pypa/pipenv.git'}}


Or move from *Pipfile* format to *requirements.txt*:

::

>>> r = Requirement.from_pipfile(name='pythonfinder', indexes=[], pipfile={'path': '../pythonfinder', 'editable': True})
>>> r.as_line()
'-e ../pythonfinder'


Integrations
*************

* `Pip <https://github.com/pypa/pip>`_
* `Pipenv <https://github.com/pypa/pipenv>`_
* `Pipfile <https://github.com/pypa/pipfile>`_

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

requirementslib-0.0.1.dev1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

requirementslib-0.0.1.dev1-py2.py3-none-any.whl (11.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file requirementslib-0.0.1.dev1.tar.gz.

File metadata

File hashes

Hashes for requirementslib-0.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 11f2343117fc7b78f72167ba20543ddbe98a2d93cbe63ad110b4fa559dc09b26
MD5 b40e68ad28ea97a32d021fc40a42decd
BLAKE2b-256 ca5b8b8ffa3507460ffb0a0637206714bfe0770c11fbc45db2677887fd5eedf2

See more details on using hashes here.

File details

Details for the file requirementslib-0.0.1.dev1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for requirementslib-0.0.1.dev1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 806a506444160482155f129ce379e86ee68284e8a03dd1eeccdbf9aac7babd00
MD5 60d36e3ab3edd3760ebda8d2f9b226d4
BLAKE2b-256 92c14dcb0a3a56297bba01bb309248b8767f49b387fa2cfae3d4bd2954267e63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page