Skip to main content

No project description provided

Project description

A simple Python lib for extracting reqs.txt from currently imported libs in the context. The lib can be used in the following scenarios:

  • Gathering the dependencies for serverless frameworks such as AWS Lambda. If several functions share the same virtualenv, unused dependecies may be introduced via pip freeze. Use importreqs will expose only the reqs imported.
  • Remove unused dependencies after refactoring, or on a long time maintained projects.

Install

pip install importreqs

Usage

To use importreqs:

import importreqs
importreqs.generate_reqs(replace_version_hash=False,
                         exclude=None)
  • replace_version_hash: For editable reqs(with -e when using pip install), remove the commit hash from result.
  • exclude: Exclude listed packages from the result. For example, importreqs itself.

For example:

# import your own projects
# for example "import app"

import importreqs

print(importreqs.generate_reqs(exclude=['importreqs']))

Or use importreqs from command line:

importreqs -c "import requests"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for importreqs, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size importreqs-0.3.1-py3-none-any.whl (8.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size importreqs-0.3.1.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page