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]'])

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)

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

Uploaded Source

File details

Details for the file install-requires-0.2.1.tar.gz.

File metadata

  • Download URL: install-requires-0.2.1.tar.gz
  • Upload date:
  • Size: 2.5 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.2.1.tar.gz
Algorithm Hash digest
SHA256 1f78e260f2e666266117ff760d5fcc93366b040e2ad4b4221f32f70b073be343
MD5 fd90dfafb4075c099a9337ceec441e20
BLAKE2b-256 2bdbbae4704a9abe5e0eac93abcadc99d95c49099d639e9296fa0cb847be908e

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