--- id: pypickle version: "2.0.2" license: MIT license_treatment: permissive maintenance: active --- # pypickle — pypickle is a Python library to save and load variables in pickle files. License: permissive · Maintenance: active · Downloads: 94.3K/mo ## What it is and what it does pypickle is a wrapper around Python's pickle module that adds security-first validation before loading serialized data. It classifies modules as high-risk (like `os`, `sys`) and blocks them by default unless explicitly allowed, preventing arbitrary code execution from untrusted pickle files. The library provides `save()` and `load()` functions alongside utility methods to check critical filesystem paths and identify risky modules within a pickle. The package targets developers who need to persist Python objects—models, session data, configuration—but want protection against pickle deserialization exploits. It requires Python 3+ and has no external dependencies, making it a lightweight drop-in for projects already using pickle. Use it for: - Loading pickled machine learning models from untrusted sources while blocking dangerous module imports - Saving application state or cached data with filesystem safety checks to prevent overwrites to system paths - Validating pickle files before processing in data pipelines to catch potentially malicious payloads - Sharing serialized Python objects between services with explicit module whitelisting for security ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. pypickle wraps Python's pickle module to save and load serialized data with built-in validation and safety checks against risky modules before deserialization. Yes, if you load pickle files from any source you don't fully control. The validation layer adds meaningful protection against a real pickle deserialization threat without breaking standard workflows. No security vulnerabilities on record, low friction, and active maintenance. Skip it only if you never deserialize untrusted pickles or have already implemented equivalent validation. ## Install pip install pypickle uv add pypickle poetry add pypickle ## Installing pypickle Before you install: Low install friction with no runtime dependencies. Actively maintained as of 2026-08-13 with recent release history. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions. Quickstart: pip install pypickle import pypickle # Save data data = [1, 2, 3, 4, 5] pypickle.save('test.pkl', data) # Load data with validation loaded = pypickle.load('test.pkl') Verify before relying: - Whether the twenty high-risk modules listed in documentation are sufficient for typical threat models - Performance overhead of validation checks compared to standard pickle - Compatibility of pickles created by pypickle with standard pickle.load() ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 94.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pickle serialization with validation, safe pickle loading, python data persistence, secure pickle wrapper, pickle file safety checks, security, serialization, data-persistence [View on SkillFed](https://skillfed.io/packages/pypickle) · [View on PyPI](https://pypi.org/project/pypickle/)