zodbpickle
Fork of Python 3 pickle module
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 zodbpickleuv
uv add zodbpicklepoetry
poetry add zodbpickleInstalling 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
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
pickle5Backports the pickle 5 protocol (PEP 574) and…
permissive · top 15,000 on PyPI
tblibSerializes exceptions and tracebacks to pickle…
permissive · top 1,000 on PyPI
ZODBZODB is an object-oriented database for Python…
unclear · top 15,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
persistentProvides transparent persistence for Python…
unclear · top 15,000 on PyPI
compress-pickleWraps Python's standard pickle serialization…
permissive · top 15,000 on PyPI
BTreesBTrees provides persistent, scalable B-tree…
unclear · top 15,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
traceback2Provides a backport of Python's traceback…
permissive · top 5,000 on PyPI
jsonpicklejsonpickle converts complex Python objects to…
permissive · top 5,000 on PyPI