deferred-import
Lazy import and install on demand Python packages.
- Package will be loaded only when you use it in the first time. Deferring it makes module loading much faster.
- 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]>
Release files for deferred-import 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deferred-import-0.1.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deferred_import-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / deferred-import-0.1.0.tar.gz
| Download URL | deferred-import-0.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f03d2be2465e15797d3b556040a56bab61d6a5baa9936b767713b19e9221ed9
|
|
BLAKE2b-256 checksum How to use checksums |
1fea520d8632a1dc5bb437739045665e642b9be04e1cc3e07607b463e5a76992
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Release files / deferred_import-0.1.0-py3-none-any.whl
| Download URL | deferred_import-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
261cc26159009d134501b43a94a4b723b4b064dc81f62e545c63d4a86e9332f1
|
|
BLAKE2b-256 checksum How to use checksums |
9e5c39896a2af70994e0b7ed2765fcc9813cabf48b03269f0e5a49034df927cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|