skillfed

persistent

Translucent persistent objects

persistent v6.7 350.2K downloads/30d#7,332 on PyPI47
License unclear ZPL-2.1 Active released

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 persistent

uv

uv add persistent

poetry

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 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

Development Status :: 6 - MatureFramework :: ZODBIntended 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 :: PyPyTopic :: DatabaseTopic :: Software Development :: Libraries :: Python Modules

Tags

persistent object storageautomatic object persistenceZODB integrationtransparent database persistencePython object cachingpersistent data structuresobject state management
zodbobject-persistencedatabase-abstraction

More Python Modules packages