pickle

Stdlib — SerializationPython 2.0+Intermediate

Serialize/deserialize Python objects to binary format

Quick Info

Documentation
Official Docs
Python Version
2.0+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
import pickle

data = {"name": "Alice", "scores": [95, 87, 91]}
pickled = pickle.dumps(data)
print(f"Pickled: {pickled[:50]}...")

unpickled = pickle.loads(pickled)
print(f"Unpickled: {unpickled}")

The pickle module is part of Python's standard library. Serialize/deserialize Python objects to binary format.

Try in Playground

Tags

stdlibserializationpersistencebinary

Related Items