dill

0.4.1 · active · verified Sat Mar 28

dill extends Python's pickle module for serializing and deserializing Python objects, supporting a wide range of built-in types. The current version is 0.4.1, released on January 19, 2026, with active development and regular updates.

Warnings

Install

Imports

Quickstart

A basic example demonstrating how to serialize and deserialize an object using dill.

import dill

# Serialize an object
obj = {'key': 'value'}
with open('obj.pkl', 'wb') as f:
    dill.dump(obj, f)

# Deserialize the object
with open('obj.pkl', 'rb') as f:
    loaded_obj = dill.load(f)
print(loaded_obj)

view raw JSON →