Extends Python's pickle to serialize almost any Python object
open sourceBSD-3-Clausefree
dill extends Python's pickle module to serialize and deserialize most built-in Python types, with the same interface as pickle. It can also pickle lambdas, nested functions, functions with yields, classes, modules and code objects that pickle can't, save and load a whole interpreter session, extract the source of functions and classes, and help diagnose pickling errors. Its main use is sending Python objects across the network as byte streams. It isn't secure against malicious data, so only unpickle data you trust. It's part of the pathos framework. Install it from PyPI as dill.
Problems it solves
- pickle a lambda or nested function in Python without a PicklingError
- send a Python function to another machine to run there
- save my whole Python interpreter session and restore it later
Features
- same interface as Python's pickle module
- pickles lambdas, nested functions, classes, modules and code objects
- saves and loads whole interpreter sessions
- extracts the source code of functions and classes
- tools to diagnose pickling errors
Limitations
Alternatives
The same job
These do what dill does.
- cloudpickle Pickle Python constructs the standard pickle module can't
