{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/4"},{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/3"},{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/6"}],"enrichment":{"capability":"Defers loading of module attributes and their dependencies until first access, and provides optional imports that delay exceptions until use.","skillfed_tags":["import-optimization","performance","optional-deps"],"use_cases":["Reduce startup time in CLI tools or services by deferring heavy dependencies until needed.","Support optional features that depend on packages users may not have installed.","Defer import exceptions for optional dependencies to the point where they're actually called.","Minimize memory footprint in large monolithic packages by loading submodules on demand.","Structure package exports with type-checking support while keeping runtime imports lazy."],"what_it_does":"lazy-imports is a utility for deferring module attribute loading until they are actually accessed, along with a context manager for optional imports that delay exceptions until use. It wraps Python's import system to avoid loading submodules and their dependencies upfront, which can reduce startup time and memory footprint in large projects.\n\nThe package provides three main tools: LazyModule for defining lazy attributes in a module's __init__.py (with support for type checking via TYPE_CHECKING), try_import for wrapping optional package imports so exceptions are raised only when the package is actually used, and LazyImporter (a legacy API) for simpler lazy import structures. The fact sheet emphasizes that Python's import system has complex side effects, so lazy imports require careful use in well-structured projects, but the package handles the low-level details so you don't have to.","worth_installing":"Yes, if you need to defer module loading to reduce startup time or memory use. The package is stable (Production/Stable status) with no known vulnerabilities and low install friction. Maintenance is aging (229 days since last release) but the repository remains active. Best suited for projects with heavy dependencies or optional features; requires Python 3.10 or later and careful use in well-structured code."},"id":"lazy-imports","links":{"html":"https://skillfed.io/packages/lazy-imports","md":"https://skillfed.io/packages/lazy-imports.md","pypi":"https://pypi.org/project/lazy-imports/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2025-12-28","license_spdx":null,"license_treatment":"permissive","name":"lazy-imports","python_support":"supports_current","summary":"Tool to support lazy imports"},"popularity":{"monthly_downloads":2093769,"position":3300,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.2.0"}
