skillfed

zodbpickle

Fork of Python 3 pickle module

zodbpickle v4.4 220.2K downloads/30d#9,309 on PyPI18
License unclear ZPL-2.1 Active released

What it is and what it does

zodbpickle is a fork of Python's pickle module designed to bridge serialization between Python 2 and 3 codebases, particularly for ZODB (Zope Object Database) applications. It adds support for protocol 3 opcodes under Python 2 and restores the noload() operation removed in Python 3, which ZODB uses to retrieve persistent references without loading objects into memory.

The package handles the tricky cross-version problem where Python 2 strings and Python 3 bytes have different semantics: it provides encoding options (like errors='bytes') to let you control whether legacy pickles deserialize as bytes or strings. It also offers a choice between fast C-based and slow pure-Python implementations, useful for debugging or when C extensions aren't available. No runtime dependencies means it integrates cleanly into existing projects.

Use it for:

  • Migrating ZODB databases from Python 2 to Python 3 while preserving pickled object compatibility
  • Loading legacy Python 2 pickles in Python 3 applications with correct string/bytes handling
  • Optimizing ZODB cache behavior by using noload() to inspect persistent references without object instantiation
  • Comparing pickle behavior between C and pure-Python implementations during debugging
  • Building cross-version serialization layers where standard pickle doesn't handle protocol 3 or legacy opcodes

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a ZODB-compatible pickle interface that handles cross-version serialization between Python 2 and 3, with support for protocol 3 opcodes and the noload() operation.

Yes, if you work with ZODB or need to deserialize Python 2 pickles in Python 3. The package is actively maintained, has no security vulnerabilities, and solves a real compatibility problem. Install friction is moderate due to C compilation, but wheels are available for common platforms. Verify ZPL-2.1 license compatibility with your project first.

Install

zodbpickle on PyPI

pip

pip install zodbpickle

uv

uv add zodbpickle

poetry

poetry add zodbpickle

Installing zodbpickle

Before you install

Medium install friction due to compiled C extensions across multiple platforms (macOS x86/ARM, Linux i686/aarch64/x86_64, Windows). Active maintenance with recent release (102 days ago) and support for current Python versions including 3.14.

License in practice

Licensed under ZPL-2.1 (Zope Public License 2.1), but license treatment is marked unclear in the fact sheet—verify compatibility with your project's licensing requirements before use.

Quickstart

from zodbpickle import pickle

# Load Python 2 pickle on Python 3
data = pickle.loads(b"S'\\xff'\np0\n.", encoding='bytes')

# Or use explicit implementation choice
from zodbpickle import fastpickle  # always C
from zodbpickle import slowpickle  # always Python

Requires Python 3.10 or later; compiled C extensions must build for your platform. Pickle module security warning: never unpickle untrusted data.

Verify before relying

  • Exact scope of ZPL-2.1 license compatibility with common project licenses
  • Performance characteristics of fastpickle vs slowpickle for typical workloads
  • Whether noload() operation is actively used by ZODB or legacy-only

Package facts

License ZPL-2.1 (unclear)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 102 days since the last release
Last repo commit
First released
Downloads 220,204/month — #9,309 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: zodbpickle-4.4-cp310-cp310-macosx_10_9_x86_64.whl; zodbpickle-4.4-cp310-cp310-macosx_11_0_arm64.whl; zodbpickle-4.4-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zodbpickle-4.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zodbpickle-4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; zodbpickle-4.4-cp310-cp310-win_amd64.whl; zodbpickle-4.4-cp311-cp311-macosx_10_9_x86_64.whl; zodbpickle-4.4-cp311-cp311-macosx_11_0_arm64.whl; zodbpickle-4.4-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zodbpickle-4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zodbpickle-4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; zodbpickle-4.4-cp311-cp311-win_amd64.whl; zodbpickle-4.4-cp311-cp311-win_arm64.whl; zodbpickle-4.4-cp312-cp312-macosx_10_9_x86_64.whl; zodbpickle-4.4-cp312-cp312-macosx_11_0_arm64.whl; zodbpickle-4.4-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl; zodbpickle-4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; zodbpickle-4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; zodbpickle-4.4-cp312-cp312-win_amd64.whl; zodbpickle-4.4-cp312-cp312-win_arm64.whl

Keywords: zodb, pickle

Development Status :: 5 - Production/StableFramework :: 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

zodb pickle compatibilitypython 2 3 pickle bridgecross-version serializationpickle protocol 3 supportnoload pickle operationbinary pickle handlingzodb persistent references
zodbserializationcross-version

More Python Modules packages