$npx skillfedfor your agent

lazy-import

A module for lazy loading of Python modules

SkipPyPI Python ModulesReleased Jan 201892.0K downloads / moGPLSource build

Decision gist · record as of 2026-08-14

sdist only — lazy_import-0.2.2.tar.gz · builds from source
v0.2.2 · released 2018-01-22

No. The package is abandoned (last updated January 2018, no commits since July 2023) and targets Python 2.7 and early Python 3 versions. Compatibility with modern Python is uncertain. The GPLv3 copyleft license restricts use in proprietary projects. Unless you are maintaining legacy Python 2.7 code or have specific compatibility constraints, modern alternatives or native Python features (e.g., importlib, __getattr__ on modules) are safer choices.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Package targets Python 2.7 and Python 3.3–3.6; compatibility with Python 3.7+ is not explicitly stated and may require testing.
  • Installation friction is high and maintenance is abandoned: the package has not been updated since January 2018 and the repository shows no recent activity.
  • It targets Python 2.7 and early Python 3 versions, which may cause compatibility issues with modern Python environments.

License · maintenance · safety

GPL (copyleft) — Released under GPL v3 (copyleft). Any code that imports lazy_import must be compatible with GPLv3 terms; proprietary or incompatibly-licensed projects cannot use it without legal review.

last release 2018-01-22 (3126 days) · last repo commit 2023-07-05 · 88 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 92,001 downloads/mo, #13,490 on PyPI

Verify before relying

import lazy_import
np = lazy_import.lazy_module("numpy")
# numpy loads only when np.pi or another attribute is accessed
np.pi  # triggers full loading
  • Whether lazy_import works reliably with Python 3.7 and later versions despite the lack of recent updates.
  • Real-world performance gains in typical application scenarios compared to standard imports.
  • Interaction with modern import systems (e.g., namespace packages, PEP 420) not documented in the excerpt.
Same gist for agents: .md · .json

What it is and what it does

lazy_import provides functions to defer the loading of Python modules and callables until they are actually used. Instead of importing a module immediately, you register it as lazy, and the actual import and initialization happen only when you access an attribute or call the function. This is useful for optional dependencies that have heavy loading times or memory footprints—you pay the cost only if the module is needed.

The package works by wrapping modules and callables without using import hooks, so it has minimal impact on other code in the same session. When a lazy module is registered in sys.modules, any subsequent import of that module in the same session gets the lazy version until it is fully loaded. Once an attribute is accessed, the module loads in place and behaves like a normal module thereafter.

Use it for

  • Reduce startup time in CLI tools or servers that load heavy optional libraries like numpy or scipy only in certain code paths.
  • Delay ImportError for missing optional dependencies until they are actually needed, allowing graceful fallback or user-friendly error messages.
  • Defer initialization of large machine-learning or scientific libraries in applications where they may not be used in every execution.
  • Mark optional submodules as lazy at package initialization so downstream code can import them normally while they remain lazy.
  • Wrap callable functions to defer their module loading until the function is actually invoked.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Skip

No.

The package is abandoned (last updated January 2018, no commits since July 2023) and targets Python 2.7 and early Python 3 versions. Compatibility with modern Python is uncertain. The GPLv3 copyleft license restricts use in proprietary projects. Unless you are maintaining legacy Python 2.7 code or have specific compatibility constraints, modern alternatives or native Python features (e.g., importlib, __getattr__ on modules) are safer choices.

Install

lazy-import on PyPI

Before you install

Installation friction is high and maintenance is abandoned: the package has not been updated since January 2018 and the repository shows no recent activity. It targets Python 2.7 and early Python 3 versions, which may cause compatibility issues with modern Python environments.

Package targets Python 2.7 and Python 3.3–3.6; compatibility with Python 3.7+ is not explicitly stated and may require testing.

License in practice

Released under GPL v3 (copyleft). Any code that imports lazy_import must be compatible with GPLv3 terms; proprietary or incompatibly-licensed projects cannot use it without legal review.

Quickstart

import lazy_import
np = lazy_import.lazy_module("numpy")
# numpy loads only when np.pi or another attribute is accessed
np.pi  # triggers full loading

Verify before relying

  • Whether lazy_import works reliably with Python 3.7 and later versions despite the lack of recent updates.
  • Real-world performance gains in typical application scenarios compared to standard imports.
  • Interaction with modern import systems (e.g., namespace packages, PEP 420) not documented in the excerpt.

Package facts

LicenseGPL copyleft
Python supportNot specified
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceAbandoned 3,126 days since the last release
Last repo commit
First released
Downloads92,001 / month, #13,490 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Operating System :: OS IndependentProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Software Development :: Libraries :: Python Modules

Evidence: lazy_import-0.2.2.tar.gz

Tags

Capabilities
lazy module loadingdefer import errorsoptional dependency loadingdelay module initializationlazy callable wrapperconditional importperformance optimization imports
Topics
import-optimizationlazy-loadinglegacy-python

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “lazy module loading”

  • lazy-importDefers module loading and ImportErrors until a module or callable is…
  • lazy-importsDefers loading of module attributes and their dependencies until…
  • lazyasdProvides lazy-loading and self-destructive proxy objects to defer…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also lazy-loader · lazy-imports · lazyasd · Lazify · slicerator · proxy_tools · lazy · lml · lazy-model · xmod