https://github.com/orsinium-labs/deferred-import
Lazy import and install on demand Python packages
https://github.com/orsinium-labs/deferred-import
dependencies import lazy-loading python
Last synced: 6 months ago
JSON representation
Lazy import and install on demand Python packages
- Host: GitHub
- URL: https://github.com/orsinium-labs/deferred-import
- Owner: orsinium-labs
- License: mit
- Created: 2021-02-04T17:27:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-05T14:05:48.000Z (over 4 years ago)
- Last Synced: 2025-03-29T01:34:12.044Z (6 months ago)
- Topics: dependencies, import, lazy-loading, python
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
1. If module is missed, the package will be automatically installed. It allows to make some project dependencies optional and install them on demand.## Installation
```bash
python3 -m pip install --user deferred-import
```## Usage
```python
from deferred_import import deferred_importrequests = deferred_import('requests')
attr = deferred_import('attr', package='attrs')requests.get('http://httpbin.org/status/200')
#
```