Python LazyModule to replace python import statement for fast import
Project description
LazyModule
Install
pip install lazy_module
How to use
import time
start = time.time()
import pandas as pd
print('Import time:', time.time()-start)
Import time: 0.425051212310791
Lazy import
start = time.time()
pd = LazyModule('pandas')
plt = LazyModule('plt', old_import='from matplotlib.pyplot as plt')
print('Import time:', time.time()-start)
# Ipython tabcomplition should work normally
Import time: 0.00010013580322265625
Issue
- Class import is not suported yet, assertion error will occor at runtime when the object is being called
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lazy_module-0.0.1.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for lazy_module-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 736bd018406653844f860ff70024afb7aa9371d618326c60edb9863a3fb87762 |
|
MD5 | e92d4c1df66a68e714b5e869dd91ea1d |
|
BLAKE2b-256 | cd91405bd1759c64cfaf496ee12435a3e98e061bac7e3b4ad378fb412b172750 |