talira

cloudpickle

Pickle Python constructs the standard pickle module can't

open sourceBSD-3-Clausefree

cloudpickle serializes Python constructs the standard library's pickle module doesn't support, including lambda functions and functions and classes defined interactively in __main__ (a script, shell or Jupyter notebook). It's especially useful for cluster computing, where Python code is shipped over the network to run on remote hosts near the data. It was extracted from PiCloud's cloud package.

Problems it solves

  • pickle a lambda function in Python
  • send Python functions to remote workers
  • serialize functions defined in a Jupyter notebook

Features

  • pickle lambdas and interactively defined functions and classes
  • ship code to remote workers for cluster computing

Limitations

  • Objects can only be exchanged between the exact same Python version, and long-term storage is unsupported.1
  • Only load pickle data from trusted sources: loading can execute arbitrary code.1

Alternatives

The same job

These do what cloudpickle does.

  1. dill Extends Python's pickle to serialize almost any Python object

Compare cloudpickle with the top 3