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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file deferred-import-0.1.0.tar.gz.

File metadata

  • Download URL: deferred-import-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for deferred-import-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f03d2be2465e15797d3b556040a56bab61d6a5baa9936b767713b19e9221ed9
MD5 954c28b2cbe2c6940afd23af11c07817
BLAKE2b-256 1fea520d8632a1dc5bb437739045665e642b9be04e1cc3e07607b463e5a76992

See more details on using hashes here.

File details

Details for the file deferred_import-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deferred_import-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 261cc26159009d134501b43a94a4b723b4b064dc81f62e545c63d4a86e9332f1
MD5 abbaeef88bc3091ab59d02d158be33d2
BLAKE2b-256 9e5c39896a2af70994e0b7ed2765fcc9813cabf48b03269f0e5a49034df927cc

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