zope.interface
Interfaces for Python
Decision gist · record as of 2026-08-14
Yes, if you need formal interface contracts and design-by-contract patterns in Python. The package is production-stable, actively maintained, has no runtime dependencies, and is widely used in the Python ecosystem. The only caveat is to verify that ZPL-2.1 is compatible with your project's licensing requirements, as the fact sheet marks license treatment as unclear.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; C extension wheels are provided for common platforms but source builds require a C compiler.
- Medium install friction due to compiled C extension wheels, but well-maintained with active development (last commit 2026-08-13) and broad platform coverage (macOS, Linux, Windows, ARM64).
- No runtime dependencies simplifies deployment.
License · maintenance · safety
ZPL-2.1 (unclear) — Licensed under ZPL-2.1 (Zope Public License 2.1), but license treatment is marked unclear in the fact sheet—verify compatibility with your project's license policy before use.
last release 2026-05-26 (80 days) · last repo commit 2026-08-13 · 351 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 66,356,928 downloads/mo, #484 on PyPI
Alternatives
Verify before relying
pip install zope.interface
from zope.interface import Interface, implementer
class IGreeter(Interface):
"""A greeter interface."""
pass
@implementer(IGreeter)
class Greeter:
pass- Whether ZPL-2.1 is compatible with your project's license constraints (treatment marked 'unclear' in metadata).
- Performance characteristics of the C extension versus pure-Python fallback in your use case.
What it is and what it does
zope.interface is a mature library that implements object interfaces—a mechanism for labeling Python objects as conforming to a declared API or contract. It is the reference implementation of design-by-contract methodology in Python, allowing developers to define formal interface specifications and verify that classes and objects satisfy them. The package provides decorators and utility functions to declare interfaces, mark implementations, and query interface relationships at runtime.
The library is independently reusable and maintained by the Zope Toolkit project. It has no runtime dependencies, ships with precompiled wheels for Python 3.10–3.14 on macOS, Linux (including ARM64), and Windows, and includes a C extension for performance-critical operations. It is actively maintained, with recent releases addressing free-threaded Python support and compatibility with Python 3.14.
Use it for
- Define formal API contracts in plugin systems or component architectures where third-party code must conform to known interfaces.
- Validate that classes implement required methods and attributes before instantiation in frameworks or libraries.
- Build introspectable component registries that query object capabilities at runtime based on declared interfaces.
- Document expected object behavior through executable interface specifications rather than docstrings alone.
- Implement adapter patterns where objects are adapted to different interfaces on demand.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need formal interface contracts and design-by-contract patterns in Python.
The package is production-stable, actively maintained, has no runtime dependencies, and is widely used in the Python ecosystem. The only caveat is to verify that ZPL-2.1 is compatible with your project's licensing requirements, as the fact sheet marks license treatment as unclear.
Install
zope-interface on PyPI
Before you install
Medium install friction due to compiled C extension wheels, but well-maintained with active development (last commit 2026-08-13) and broad platform coverage (macOS, Linux, Windows, ARM64). No runtime dependencies simplifies deployment.
Requires Python 3.10 or later; C extension wheels are provided for common platforms but source builds require a C compiler.
License in practice
Licensed under ZPL-2.1 (Zope Public License 2.1), but license treatment is marked unclear in the fact sheet—verify compatibility with your project's license policy before use.
Quickstart
pip install zope.interface
from zope.interface import Interface, implementer
class IGreeter(Interface):
"""A greeter interface."""
pass
@implementer(IGreeter)
class Greeter:
pass
Verify before relying
- Whether ZPL-2.1 is compatible with your project's license constraints (treatment marked 'unclear' in metadata).
- Performance characteristics of the C extension versus pure-Python fallback in your use case.
Package facts
| License | ZPL-2.1 unclear |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 80 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 66,356,928 / month, #484 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 :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming 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 :: PyPy |
Evidence: zope_interface-8.5-cp310-cp310-macosx_10_9_x86_64.whl; zope_interface-8.5-cp310-cp310-macosx_11_0_arm64.whl; zope_interface-8.5-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zope_interface-8.5-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; zope_interface-8.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zope_interface-8.5-cp310-cp310-win_amd64.whl; zope_interface-8.5-cp311-cp311-macosx_10_9_x86_64.whl; zope_interface-8.5-cp311-cp311-macosx_11_0_arm64.whl; zope_interface-8.5-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zope_interface-8.5-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; zope_interface-8.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zope_interface-8.5-cp311-cp311-win_amd64.whl; zope_interface-8.5-cp311-cp311-win_arm64.whl; zope_interface-8.5-cp312-cp312-macosx_10_9_x86_64.whl; zope_interface-8.5-cp312-cp312-macosx_11_0_arm64.whl; zope_interface-8.5-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zope_interface-8.5-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; zope_interface-8.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zope_interface-8.5-cp312-cp312-win_amd64.whl; zope_interface-8.5-cp312-cp312-win_arm64.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 › “object interface declaration”
- zope.interfaceProvides a Python implementation of object interfaces for declaring…
- python-interfaceDeclares interfaces and statically asserts that classes implement…
- valohai-papiPapi provides an imperative Python API for declaring Valohai machine…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
A mypy plugin that treats zope.interface declarations as types, enabling type checking for zope-based code with interface polymorphism, schema field inference, and adaptation patterns.
Implements the core Zope Component Architecture for defining, registering, and looking up components through interfaces, enabling loose coupling in Python applications.
However, the aging maintenance status (192 days since last release) and unclear license treatment warrant verification before adoption in new projects outside the…
Defines structured data schemas for Python objects using interface-based field definitions with validation, constraints, and metadata.
However, the aging maintenance status and unclear license treatment warrant review before adoption in new projects outside the Zope community.
Provides container interfaces and implementations (BTreeContainer, OrderedContainer) for organizing and managing objects in Zope-based applications, with support for object containment, traversal, and lifecycle events.
However, verify that ZPL-2.1 is compatible with your project's license requirements (marked unclear), and be aware of the 19 runtime dependencies—this is a…
zope.proxy provides transparent wrapper objects that intercept and control access to wrapped objects, implemented as a C extension for performance and to support advanced features like lying about __class__.
Provides a metaclass that enables extension module classes to be subclassed in Python, along with utilities for computed attributes and method objects on ExtensionClass instances.
See also zope.testrunner · zope.publisher · zope.filerepresentation · deal