Skip to main content

iantirta-lazy_import ⚡

Lazy Import utilities

PyPI Version Python Version Tests Documentation License GitHub

iantirta-lazy_import is a zero-dependency, ultra-fast Python utility designed to slash package startup times through intelligent, on-demand lazy module loading. Built for high-performance enterprise and developer ecosystems, it turns heavy initialization sequences into instant sub-millisecond warm starts.


Why Choose iantirta-lazy_import?

  • Zero Dependencies: Built entirely on Python's robust standard library (importlib, re, os). No bloat, no heavy external baggage.
  • Blazing Fast Warm Starts: Caches directory structures and module maps via @lru_cache, reducing initialization overhead to ~0.02 ms.
  • Smart __all__ Extraction: Employs pre-compiled regular expressions that seamlessly parse multi-line lists ([...]), tuples ((...)), and comment-heavy code blocks.
  • IDE Autocompletion Friendly: Custom __dir__ implementation ensures submodules and exported attributes appear cleanly in modern IDE drop-downs before they are loaded into memory.

Installation

Install the package directly from PyPI:

pip install iantirta-lazy_import

For development and testing:

pip install "iantirta-lazy_import[dev]"

Quick Start

To enable lightning-fast lazy loading for your package, wire it up inside your package's root init.py:

from typing import TYPE_CHECKING

from iantirta.lazy_import import define_import_structure, LazyModule

if TYPE_CHECKING:
    # Do something here for typechecking IDE
else:
    import sys

    _file = globals()["__file__"]
    sys.modules[__name__] = LazyModule(
        __name__,
        _file,
        define_import_structure(_file),
        module_spec=__spec__,
        # Optional:
        extra_objects={"__version__": __version__},
    )

or You can define the import structure yourself

from typing import TYPE_CHECKING

from iantirta.lazy_import import define_import_structure, LazyModule

_import_structure = {
    "module_name_1": [
        "Class1",
        "method1",
    ],
    "module_name_2": [
        "Class2",
    ],
    "module_name_2.nested": [
        "Class3",
    ]
}

if TYPE_CHECKING:
    # Do something here for typechecking IDE
else:
    import sys

    sys.modules[__name__] = LazyModule(
        __name__,
        globals()["__file__"],
        _import_structure,
        module_spec=__spec__,
    )

The Iantirta Ecosystem

iantirta-lazy_import serves as foundational infrastructure for the Iantirta.com software ecosystem, providing core optimization primitives for enterprise architecture, plugin systems, and modular backends.

🛡️ License

Copyright © Iantirta.com. Distributed under the Apache License 2.0. See LICENSE for full details.

Crafted with precision by https://www.iantirta.com

Metadata

Release files for iantirta-lazy-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)

Source distribution for iantirta-lazy-import 0.1.0
File Size Uploaded Provenance Actions
iantirta_lazy_import-0.1.0.tar.gz 11.4 kB With provenance Details for iantirta_lazy_import-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iantirta-lazy-import 0.1.0
File Interpreter ABI Platform Actions
iantirta_lazy_import-0.1.0-py3-none-any.whl Python 3 none any Details for iantirta_lazy_import-0.1.0-py3-none-any.whl

Total release size: 21.9 kB

Release files / iantirta_lazy_import-0.1.0.tar.gz

Download URL iantirta_lazy_import-0.1.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f2512142ce49f8a037923da83e31df841ddcb8e6d1d78e34b111f590d257bc21
BLAKE2b-256 checksum
How to use checksums
1f7e9c6f30f9c7cdeed84a28a6d8df76676c2a7f2ab1b382d9fde9d2ae949d68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / iantirta_lazy_import-0.1.0-py3-none-any.whl

Download URL iantirta_lazy_import-0.1.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3526c549321b7ad952bd322c2f497bdfbd16939380d5d50010e20638a97f821f
BLAKE2b-256 checksum
How to use checksums
88a28deb6334f65d7457dcae17e23b2b699e52a86c6873f04e2475c176ba7f44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Security for iantirta-lazy-import 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for iantirta_lazy_import-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page