--- id: zope-cachedescriptors version: "6.0" license: ZPL-2.1 license_treatment: unclear maintenance: aging --- # zope.cachedescriptors — Method and property caching decorators License: unclear · Maintenance: aging · Downloads: 155.4K/mo ## What it is and what it does zope.cachedescriptors provides Python descriptors that cache computed values and automatically invalidate when their dependencies change. It includes CachedProperty (which recomputes when tracked attributes change), Lazy (which computes once and stays cached until manually deleted), and cached methods. Values are stored in _v_ volatile attributes, making them especially useful for persistent object frameworks where volatile storage is a standard pattern. The package is a lightweight, dependency-minimal tool for avoiding redundant computation in classes where properties depend on instance state. It's designed for scenarios where you need fine-grained control over when a cached value is discarded—either automatically when dependencies shift, or manually when needed. It supports both decorator and functional syntax for backwards compatibility. Use it for: - Cache expensive computed properties in ORM models that invalidate when their source attributes are modified. - Implement lazy-loaded attributes that compute once on first access and persist for the object's lifetime. - Build idempotent methods whose results are cached based on arguments and instance state in persistent frameworks. - Manage volatile attribute computation in Zope or other persistence layers where _v_ attributes have special semantics. - Reduce redundant calculations in geometric or scientific classes where derived values depend on a few tracked inputs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides decorator-based caching for computed properties and methods that automatically invalidate when their dependencies change, storing cached values in volatile attributes suitable for persistent objects. Yes, if you need dependency-aware property caching in a persistent object context or are already in the Zope ecosystem. The package is stable, has no known vulnerabilities, and installs with minimal friction. However, the aging maintenance status (no release in 336 days) and unclear license treatment warrant a review before adopting in new projects outside Zope—for simpler caching, functools.cached_property may suffice. ## Install pip install zope-cachedescriptors uv add zope-cachedescriptors poetry add zope-cachedescriptors ## Installing zope.cachedescriptors Before you install: Low friction: pure Python wheel with only setuptools as a runtime dependency. Maintenance status is aging—last commit was 2025-09-12 and no release in 336 days—but the package is marked Production/Stable and has been in active use since 2007. 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. License treatment is marked unclear, so review the full license text before adopting in proprietary or copyleft-sensitive projects. Quickstart: from zope.cachedescriptors import property import math class Point: def __init__(self, x, y): self.x, self.y = x, y @property.CachedProperty('x', 'y') def radius(self): return math.sqrt(self.x**2 + self.y**2) point = Point(1.0, 2.0) print(point.radius) # Computed once, cached thereafter point.x = 2.0 print(point.radius) # Recomputed because x changed Verify before relying: - Whether ZPL-2.1 is compatible with your project's licensing requirements (treatment marked unclear in metadata). - Performance characteristics and memory overhead of cached descriptors in high-throughput scenarios. - Compatibility with modern ORMs or persistence frameworks beyond the Zope ecosystem. ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 155.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cached property decorator, method caching with dependencies, computed property invalidation, volatile attribute caching, persistent object descriptors, lazy attribute computation, dependency-aware caching, caching, descriptors, persistent-objects [View on SkillFed](https://skillfed.io/packages/zope-cachedescriptors) · [View on PyPI](https://pypi.org/project/zope-cachedescriptors/)