--- id: zope-annotation version: "6.0" license: ZPL-2.1 license_treatment: unclear maintenance: active --- # zope.annotation — Object annotation mechanism License: unclear · Maintenance: active · Downloads: 150.9K/mo ## What it is and what it does zope.annotation provides a framework for attaching arbitrary metadata to objects at runtime without modifying their class definition. It integrates with the Zope component architecture (zope.interface, zope.component, zope.location, zope.proxy) to register and retrieve annotations through a clean adapter-based API. The package is particularly useful in ZODB-backed systems where you need to associate extra data with persistent objects. The core mechanism uses IAnnotations adapters to store metadata, with AttributeAnnotations providing a dict-like interface for attribute-based storage. The package supports both in-memory dict storage and persistent BTrees storage, falling back gracefully if BTrees is unavailable. It has been actively maintained since 2007 and currently supports Python 3.9 through 3.13. Use it for: - Attach domain-specific metadata to ZODB objects without altering their schema or class hierarchy. - Store temporary or computed attributes on objects in a Zope application without modifying the persistent object structure. - Build plugin systems where different components can independently annotate shared objects with their own metadata. - Implement object traversal helpers by storing parent references via __parent__ annotations for upward navigation. - Manage object-level configuration or state in frameworks that use zope.component for adaptation. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Stores additional metadata on objects without modifying their class, using a Zope-based annotation mechanism backed by zope.interface and zope.component. Yes, if you are building within the Zope ecosystem or need a clean, non-invasive way to attach metadata to objects in a component-based architecture. The package is stable, actively maintained, and has no known vulnerabilities. The ZPL-2.1 license is OSI-approved but less mainstream; verify it aligns with your project before committing. Install friction is low and dependencies are all from the same ecosystem, so integration is straightforward for Zope-aware projects. ## Install pip install zope-annotation uv add zope-annotation poetry add zope-annotation ## Installing zope.annotation Before you install: Low install friction with a pure-Python wheel and five runtime dependencies all from the Zope ecosystem. Actively maintained with recent releases supporting Python 3.9 through 3.13; last commit was 2026-05-13. License in practice: Licensed under ZPL-2.1 (Zope Public License 2.1), which is OSI-approved but less common than MIT or Apache 2.0; verify compatibility with your project's license policy before adopting. Quickstart: from zope.annotation.interfaces import IAnnotations from zope.annotation.attribute import AttributeAnnotations # Register adapter or use directly annotations = IAnnotations(your_object) Requires Python 3.9 or later; integration with Zope component architecture assumes familiarity with zope.interface and zope.component patterns. Verify before relying: - Whether BTrees is automatically installed or only available via optional [btree] extra in version 6.0. - Concrete examples of how annotation storage differs between dict and BTrees backends in practice. - Performance characteristics when storing large numbers of annotations on a single object. ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 150.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags object annotation storage, attach metadata to objects, zope annotation mechanism, non-invasive object metadata, zope component adaptation, persistent object attributes, ZODB annotation framework, zope-ecosystem, object-metadata, adapter-pattern [View on SkillFed](https://skillfed.io/packages/zope-annotation) · [View on PyPI](https://pypi.org/project/zope-annotation/)