cloudpickle
Pickler class to extend the standard pickle.Pickler functionality
Decision gist · record as of 2026-08-14
Yes. Cloudpickle is actively maintained, has no dependencies, installs with low friction, and carries no known vulnerabilities. Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution. Avoid it for long-term object storage, and remember that unpickling requires the exact same Python version used to pickle.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Cloudpickle can only send objects between the exact same version of Python; unpickling with a different Python version is not supported.
- Low friction to install; the package is actively maintained with recent commits and is in production/stable status.
- No runtime dependencies.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is a permissive open-source license; you can use, modify, and distribute cloudpickle with minimal restrictions, provided you include the license notice.
last release 2025-11-03 (284 days) · last repo commit 2026-08-06 · 1,935 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 148,360,176 downloads/mo, #271 on PyPI
Alternatives
Verify before relying
pip install cloudpickle
import cloudpickle
import pickle
squared = lambda x: x ** 2
pickled = cloudpickle.dumps(squared)
restored = pickle.loads(pickled)
print(restored(2)) # 4- Whether cloudpickle's by-value serialization mode (available since 2.0.0) is stable enough for production use given its experimental status.
- Performance characteristics when serializing large or deeply nested interactive functions.
What it is and what it does
Cloudpickle is a serialization library that extends Python's standard pickle module to handle constructs pickle cannot normally serialize—lambda functions, functions and classes defined interactively in scripts or notebooks, and other dynamic code. It was originally developed for cluster computing environments like Apache Spark, where Python code needs to be shipped over the network to execute on remote machines.
The package is designed for short-term, in-transit serialization in distributed systems, not for long-term storage. It supports both CPython and PyPy across modern Python versions (3.8 and later). A key feature is the ability to serialize functions and classes by value (embedding their full definition) rather than by reference (relying on import), which is especially useful when code is being developed in an interactive environment or on a machine different from where it will execute. The library includes an API to explicitly control serialization mode for specific modules.
Use it for
- Shipping lambda functions and interactively-defined functions to worker nodes in a distributed computing cluster.
- Serializing Jupyter notebook functions to send to remote execution environments without requiring code to be installed as a module.
- Passing dynamically-defined classes and functions across process boundaries in a multi-process or distributed system.
- Developing modules in a distributed environment where worker processes may not have access to the development machine's filesystem.
- Extending pickle's capabilities in frameworks that rely on serialization for task distribution or caching.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Cloudpickle is actively maintained, has no dependencies, installs with low friction, and carries no known vulnerabilities. Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution. Avoid it for long-term object storage, and remember that unpickling requires the exact same Python version used to pickle.
Install
cloudpickle on PyPI
Before you install
Low friction to install; the package is actively maintained with recent commits and is in production/stable status. No runtime dependencies.
Cloudpickle can only send objects between the exact same version of Python; unpickling with a different Python version is not supported.
License in practice
BSD-3-Clause is a permissive open-source license; you can use, modify, and distribute cloudpickle with minimal restrictions, provided you include the license notice.
Quickstart
pip install cloudpickle
import cloudpickle
import pickle
squared = lambda x: x ** 2
pickled = cloudpickle.dumps(squared)
restored = pickle.loads(pickled)
print(restored(2)) # 4
Verify before relying
- Whether cloudpickle's by-value serialization mode (available since 2.0.0) is stable enough for production use given its experimental status.
- Performance characteristics when serializing large or deeply nested interactive functions.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 284 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,360,176 / month, #271 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Scientific/EngineeringTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Distributed Computing |
Evidence: cloudpickle-3.1.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “serialize lambda functions”
- cloudpickleCloudpickle extends Python's standard pickle module to serialize…
- dilldill extends Python's pickle module to serialize and deserialize a…
- aws-cdk.aws-lambdaDefines AWS Lambda functions and layers as infrastructure-as-code…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also jsonpickle · zodbpickle · compress-pickle · tblib · pypickle · fickling · django-picklefield · cache-to-disk · tools