Skip to main content

A lightweight and extensible way to implement lazy imports globally.

Project description

Lazi: Lazy Imports Everywhere

A lightweight and extensible way to implement lazy imports globally.

Usage:

poetry add lazi
"""example.py

Automatic lazy loading example.
Install django to run, or change the imports.
"""
import lazi.auto                 # Install import tracking.
import django.test               # Import stuff.
print(len(lazi.auto.RECORD))     # Peek at the internals for demonstration.
TestCase = django.test.TestCase  # Trigger lazy loading.
print(len(lazi.auto.RECORD))     # More modules were lazy loaded.
python example.py
6
198

Metadata

Reference for developers: The json dict below contains Python versioning parameters:

  • Soft min (ignore rev) & hard max compatible versions.
  • Recommended use & creator's environment dev versions.
{
  "python": {
    "version": {
      "min": "3.10.11",
      "max": "3.12",
      "use": "3.11",
      "dev": "3.11.2"
    }
  }
}

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

lazi-1.0.3.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

lazi-1.0.3-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

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