Skip to main content

pypickle

Python PyPI Version GitHub Repo stars License Downloads Downloads DOI Sphinx

pypickle is a user-friendly Python library for saving and loading data using the pickle format. Unlike the standard pickle module, pypickle puts safety first—offering built-in validation, extension checks, and protection against common exploits. Whether you're persisting models, storing session data, or sharing files, pypickle makes serialization easy and more secure. Ideal for developers who care about both convenience and peace of mind. ⭐️ Star it if you like it ⭐️


Key Features

Feature Description
Load Load your pickle files.
Save Save your files into pickle format.
is_critical_path Check whether filepath is critical.
get_critical_paths Get critical paths.
get_risk_modules Get risk modules.
get_allowed_paths Get allowed paths.

For security reasons, pickle files are validated by checking the inner modules before loading. Twenty modules are classified as high-risk (see here) and can not be loaded without validation.

Module Type Allowed? How to Change Behavior
Unknown ✅ Allowed unless in high-risk list
Custom safe ✅ If included in validate param
Risky (os, etc.) ❌ Must be explicitly added via validate=['nt'] or validate=False

Resources and Links


Install pypickle from PyPI
pip install pypickle     # normal install
pip install -U pypickle  # update if needed

Import pypickle package

import pypickle

Example: Saving

import pypickle
filepath = 'test.pkl'

# Some data
data = [1,2,3,4,5]

# Save
status = pypickle.save(filepath, data)

Example: Loading

# Load file
data = pypickle.load(filepath)

Maintainer

  • Erdogan Taskesen, github: erdogant
  • Contributions are welcome.
  • Yes! This library is entirely free but it runs on coffee! :) Feel free to support with a Coffee.

Buy me a coffee

Release files for pypickle 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypickle 2.0.2
File Size Uploaded
pypickle-2.0.2.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypickle 2.0.2
File Interpreter ABI Platform
pypickle-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.6 kB

Release files / pypickle-2.0.2.tar.gz

Download URL pypickle-2.0.2.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d577e39cf501c7c80b1387f6d7dc885cf4efeba65f213df41226d1f24881b1e8
BLAKE2b-256 checksum
How to use checksums
281c86f268323d529e16c73999e684d835d717334fd478354556c2409b1e918b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / pypickle-2.0.2-py3-none-any.whl

Download URL pypickle-2.0.2-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3307127314465fe3dc8f0162e11777d5e8284f3a29dc48b0f770d364a85d998
BLAKE2b-256 checksum
How to use checksums
59096368f2e9916f34278204f9b1eba69a26b803e00a77796a5d7577bd6c2122
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page