persistent
Translucent persistent objects
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 on this page — 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
persistent on PyPI
pip
pip install persistentuv
uv add persistentpoetry
poetry add persistentInstalling 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 the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 3 — zope.deferredimport, zope.interface, cffi |
| Maintenance | actively maintained — 80 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 350,204/month — #7,332 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: persistent-6.7-cp310-cp310-macosx_10_9_x86_64.whl; persistent-6.7-cp310-cp310-macosx_11_0_arm64.whl; persistent-6.7-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; persistent-6.7-cp310-cp310-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; persistent-6.7-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; persistent-6.7-cp310-cp310-win_amd64.whl; persistent-6.7-cp311-cp311-macosx_10_9_x86_64.whl; persistent-6.7-cp311-cp311-macosx_11_0_arm64.whl; persistent-6.7-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; persistent-6.7-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; persistent-6.7-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; persistent-6.7-cp311-cp311-win_amd64.whl; persistent-6.7-cp311-cp311-win_arm64.whl; persistent-6.7-cp312-cp312-macosx_10_9_x86_64.whl; persistent-6.7-cp312-cp312-macosx_11_0_arm64.whl; persistent-6.7-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; persistent-6.7-cp312-cp312-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl; persistent-6.7-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; persistent-6.7-cp312-cp312-win_amd64.whl; persistent-6.7-cp312-cp312-win_arm64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ZODBZODB is an object-oriented database for Python…
unclear · top 15,000 on PyPI
BTreesBTrees provides persistent, scalable B-tree…
unclear · top 15,000 on PyPI
PersistenceProvides a persistent base class built on…
unclear · top 15,000 on PyPI
zodbpickleProvides a ZODB-compatible pickle interface…
unclear · top 15,000 on PyPI
zope.annotationStores additional metadata on objects without…
unclear · top 15,000 on PyPI
transactionProvides a generic transaction management…
unclear · top 5,000 on PyPI
zope.containerProvides container interfaces and…
unclear · top 15,000 on PyPI
seba-sqliteProvides legacy SQLite storage backend for the…
copyleft · top 15,000 on PyPI
ZopeZope is an open-source web application server…
unclear · top 15,000 on PyPI
ripserRipser computes persistent homology and…
permissive · top 15,000 on PyPI