zope.deferredimport
zope.deferredimport allows you to perform imports names that will only be resolved when used in the code.
Decision gist · record as of 2026-08-14
Yes, if you need lazy imports or deprecation warnings in a library. Low install friction, active maintenance, no known vulnerabilities, and a focused scope make it reliable for its purpose. Verify ZPL-2.1 compatibility with your project's license before committing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with a single runtime dependency (zope.proxy).
- Actively maintained with recent releases supporting Python 3.14 and dropping older versions; last commit 2026-02-16.
License · maintenance · safety
ZPL-2.1 (unclear) — Licensed under ZPL-2.1 (Zope Public License 2.1); license treatment marked unclear in metadata, so verify compatibility with your project's license policy before use.
last release 2026-02-16 (179 days) · last repo commit 2026-02-16 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 393,748 downloads/mo, #6,996 on PyPI
Alternatives
Verify before relying
from zope.deferredimport import deprecated
deprecated('old_name', 'module.new_name')
# old_name is now available but triggers a deprecation warning when accessed- Whether ZPL-2.1 is compatible with your project's licensing requirements (license_treatment is marked unclear).
- Specific use cases where deferred imports provide measurable performance or import-time overhead reduction.
- Whether zope.proxy's behavior and API are stable for your intended use.
What it is and what it does
zope.deferredimport is a utility for delaying the actual import of module names until they are first used in code. Instead of importing a name at module load time, you declare it as deferred, and the import happens only when that name is accessed. This is useful for reducing startup time in large packages or for managing circular import dependencies.
The package also supports issuing deprecation warnings when a name is used, making it a tool for library maintainers to guide users away from old APIs without breaking existing code immediately. It works by creating module proxies that intercept attribute access and trigger the real import on demand. The package depends only on zope.proxy and supports current Python versions (3.10 through 3.14).
Use it for
- Reduce module load time in large packages by deferring imports of rarely-used submodules until they are actually accessed.
- Issue deprecation warnings when users access old API names, guiding migration without immediate breakage.
- Manage circular import dependencies by deferring one side of the cycle until runtime.
- Create convenience re-exports in a package's __init__.py without paying the import cost upfront.
- Provide backward compatibility by keeping old names available but deprecated, with warnings on use.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need lazy imports or deprecation warnings in a library.
Low install friction, active maintenance, no known vulnerabilities, and a focused scope make it reliable for its purpose. Verify ZPL-2.1 compatibility with your project's license before committing.
Install
zope-deferredimport on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency (zope.proxy). Actively maintained with recent releases supporting Python 3.14 and dropping older versions; last commit 2026-02-16.
Requires Python 3.10 or later.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1); license treatment marked unclear in metadata, so verify compatibility with your project's license policy before use.
Quickstart
from zope.deferredimport import deprecated
deprecated('old_name', 'module.new_name')
# old_name is now available but triggers a deprecation warning when accessed
Verify before relying
- Whether ZPL-2.1 is compatible with your project's licensing requirements (license_treatment is marked unclear).
- Specific use cases where deferred imports provide measurable performance or import-time overhead reduction.
- Whether zope.proxy's behavior and API are stable for your intended use.
Package facts
| License | ZPL-2.1 unclear |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagezope.proxy |
| Maintenance | Actively maintained 179 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 393,748 / month, #6,996 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTopic :: Software Development |
Evidence: zope_deferredimport-6.1.1-py3-none-any.whl
Tags
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 › “deferred import”
- zope.deferredimportDefers module imports until they are actually used, optionally…
- apipkgapipkg lets you define a package's exported namespace declaratively…
- mo-importsProvides patterns to resolve circular module dependencies in Python…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also zope.deprecation · venusian · zope.dottedname · apipkg · Lazify · zope.size · zope.sequencesort · proxy_tools · zope.exceptions · zope.configuration