Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

install-requires

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

install-requires

Convert requirements between formats

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc