--- id: persistent version: "6.7" license: ZPL-2.1 license_treatment: unclear maintenance: active --- # persistent — Translucent persistent objects License: unclear · Maintenance: active · Downloads: 350.2K/mo ## What it is and what it does Persistent is a core protocol library that makes Python objects interact transparently with databases, primarily ZODB. It implements automatic state tracking and serialization so that objects can be modified in memory and have those changes persisted to disk without explicit save calls. The package provides base classes like Persistent, PersistentList, and PersistentMapping that handle the bookkeeping of object changes, allowing developers to work with objects as if they were in-memory while the database layer handles durability. The library uses C extensions for performance-critical operations and falls back to pure Python implementations when needed. It has three runtime dependencies: zope.deferredimport for lazy imports, zope.interface for interface definitions, and cffi for C bindings. Recent versions add support for free-threaded Python 3.14 and 3.15, though the package is primarily designed for ZODB integration and is not recommended with ZODB versions earlier than 3.11. Use it for: - Building applications with ZODB that need automatic object persistence without manual serialization. - Creating long-lived in-memory object caches that can be transparently synced to a persistent store. - Implementing complex data structures (lists, mappings) that track their own modifications for database updates. - Developing multi-threaded applications requiring thread-safe object state management and change tracking. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides transparent persistence for Python objects, allowing them to be automatically saved to and loaded from a database like ZODB without explicit serialization code. Yes, if you are using ZODB or a compatible persistence framework. The package is mature, actively maintained, has no known vulnerabilities, and provides broad Python version and platform support. Install friction is moderate due to C extensions, but pre-built wheels are available for common platforms. Not recommended as a standalone persistence solution outside the ZODB ecosystem. ## Install pip install persistent uv add persistent poetry add persistent ## Installing persistent Before you install: Medium install friction due to C extensions and cffi dependency, but well-maintained with recent releases and broad platform support (macOS, Linux, Windows, ARM64). Active upstream development with no known security issues. License in practice: Licensed under ZPL-2.1 (Zope Public License 2.1), a permissive open-source license with no notable restrictions for most use cases. Quickstart: pip install persistent from persistent import Persistent class MyObject(Persistent): def __init__(self): self.data = [] obj = MyObject() obj.data.append('value') # Object state is now tracked for persistence Requires Python 3.10 or later; C extensions require a C compiler or pre-built wheels for your platform. Verify before relying: - Specific performance characteristics or memory overhead compared to standard Python objects. - Compatibility with non-ZODB persistence backends or whether it is ZODB-specific. - Whether the package works with free-threaded Python 3.14+ in production or only with experimental support. ## Package facts - License: ZPL-2.1 (unclear) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 350.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags persistent object storage, automatic object persistence, ZODB integration, transparent database persistence, Python object caching, persistent data structures, object state management, zodb, object-persistence, database-abstraction [View on SkillFed](https://skillfed.io/packages/persistent) · [View on PyPI](https://pypi.org/project/persistent/)