Skip to main content

Lazy import and install on demand Python packages.

Project description

deferred-import

Lazy import and install on demand Python packages.

  1. Package will be loaded only when you use it in the first time. Deferring it makes module loading much faster.
  2. If module is missed, the package will be automatically installed. It allows to make some project dependencies optional and install them on demand.

Installation

python3 -m pip install --user deferred-import

Usage

from deferred_import import deferred_import

requests = deferred_import('requests')
attr = deferred_import('attr', package='attrs')

requests.get('http://httpbin.org/status/200')
# <Response [200]>

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

deferred-import-0.1.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

deferred_import-0.1.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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