Skip to main content

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 (return install_requires and dependency_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:

  1. Pipfile -> requirements.txt
  2. Pipfile.lock -> requirements.txt
  3. 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:

  1. Pipfile -> requirements.txt
  2. Pipfile.lock -> requirements.txt
  3. pyproject.toml -> requirements.txt
  4. Pipfile -> setup.py
  5. Pipfile.lock -> setup.py
  6. pyproject.toml -> setup.py
  7. 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

install-requires-0.3.0.tar.gz (2.9 kB view details)

Uploaded Source

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

Hashes for install-requires-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d6229486e085a330041d3cc6f47eeb8d2fd0c255cf81a4b899b287c306deb717
MD5 e3b1c76d41303056239056548c160be1
BLAKE2b-256 d30563a5ebe7a99a1b815a88a9ffad485d4a0b5839d8df5179554bb16db7cda6

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