A tool for converting between pip-style and pipfile requirements.
Project description
Installation
Install from PyPI:
$ pipenv install --pre requirementslib
Install from Github:
$ pipenv install -e git+https://github.com/techalchemy/requirementslib.git#egg=requirementslib
Summary
RequirementsLib provides a simple layer for building and interacting with requirements in both the Pipfile format and the requirements.txt format. This library was originally built for converting between these formats in Pipenv.
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
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.5.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file requirementslib-0.0.5.tar.gz
.
File metadata
- Download URL: requirementslib-0.0.5.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfec8cd89307196fa11d7ecc8ffdc15d0a2ca5122d5f8cd6372d8f1919b9d32e |
|
MD5 | 95b7ea0778ac9dec4c6981c935d613ff |
|
BLAKE2b-256 | 75a8c0c34a9d9f6eec3554c302f6d015accd1fee8e9ff0d4f21a064f70e12e5d |
File details
Details for the file requirementslib-0.0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: requirementslib-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db8a26dc4f458e861cb3b547521169e719ed9e63a3f6d4351ef3f728967fe720 |
|
MD5 | 7663c424b6d57425d6817c7433acd182 |
|
BLAKE2b-256 | cbf0c2afaed7bb94d77a1d92835a05c43de399ac77836cfc52832637fedd22e8 |