Skip to main content

Python LazyModule to replace python import statement for fast import

Project description

LazyModule

Install

pip install --upgrade pip && pip install lazy_module
#or
pip install git+https://github.com/anhvth/lazy_module

How to use

import time
start = time.time()
import pandas as pd
print('Import time:', time.time()-start)
Import time: 0.30898594856262207

Lazy import

from lazy_module.core import *
start = time.time()
pd = LazyModule('pandas')
print('Import time:', time.time()-start)
# Ipython tabcomplition should work normally
Import time: 5.507469177246094e-05

Issue

  • Class import is not suported yet, assertion error will occor at runtime when the object is being called

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

lazy_module-0.0.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

lazy_module-0.0.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file lazy_module-0.0.3.tar.gz.

File metadata

  • Download URL: lazy_module-0.0.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.5

File hashes

Hashes for lazy_module-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cd0cc79db9e8d2f8604611f0117de4316b342c3ae91283e5e8f0a1983b548074
MD5 ef1c7ec3d84f1d0aa374e2acacb68e8b
BLAKE2b-256 f6969f1eef037805cd6707329a81426c433eb5f7f6356d343bb40307771eae02

See more details on using hashes here.

File details

Details for the file lazy_module-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: lazy_module-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.5

File hashes

Hashes for lazy_module-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6f6c68489b5da10144b5ee438375d28e3241d5ba32b6999d9ef5da2ee54782ff
MD5 a7ed02da2c4dbb2575d202672cca1f88
BLAKE2b-256 8ecd9226d99ab5947f43a0ef64649ba05ac098f7ea716f7582860f50b59b5a1c

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