Convert requirements between formats
Project description
install_requires
Convert between dependency describing formats.
Input formats:
Pipfile
Pipfile.lock
pyproject.toml
(poetry)requirements.txt
Output formats:
setup.py
(returninstall_requires
anddependency_links
)requirements.txt
(return list of lines)
Install
Install with needed extra requirements:
pip install install-requires[pipfile]
pip install install-requires[poetry]
Or from your setup.py:
from pip._internal import main as pip
pip(['install', 'install-requires[pipfile]'])
pip(['install', 'install-requires[poetry]'])
CLI usage
install-requires example/Pipfile requirements.txt
Available conversions:
- Pipfile -> requirements.txt
- Pipfile.lock -> requirements.txt
- pyproject.toml -> requirements.txt
API usage
Pass input format, output format and path to file that must be parsed into convert
function:
from pathlib import Path
from install_requires import convert
path = Path(__file__).parent
convert('pyproject.toml', 'setup.py', path)
Available conversions:
- Pipfile -> requirements.txt
- Pipfile.lock -> requirements.txt
- pyproject.toml -> requirements.txt
- Pipfile -> setup.py
- Pipfile.lock -> setup.py
- pyproject.toml -> setup.py
- requirements.txt -> setup.py
See example for more details.
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
File details
Details for the file install-requires-0.3.0.tar.gz
.
File metadata
- Download URL: install-requires-0.3.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6229486e085a330041d3cc6f47eeb8d2fd0c255cf81a4b899b287c306deb717 |
|
MD5 | e3b1c76d41303056239056548c160be1 |
|
BLAKE2b-256 | d30563a5ebe7a99a1b815a88a9ffad485d4a0b5839d8df5179554bb16db7cda6 |