pypickle is a Python library to save and load variables in pickle files.
Project description
pypickle
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
- Documentation: Website
- Bug Reports and Feature Requests: GitHub Issues
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)
Contributors
Setting up and maintaining bnlearn has been possible thanks to users and contributors. Thanks to:
Maintainer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pypickle-2.0.1.tar.gz
.
File metadata
- Download URL: pypickle-2.0.1.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0cc1ee65293e4dfa90f0db6435e8021c6a83346be98d0fee81aceb2dad1fb091
|
|
MD5 |
7407800cb7debdf4b4ab629b28d06d6d
|
|
BLAKE2b-256 |
65f2214b962b5edf37ce86929e073ab4db953e4c495bcb58da511b4e49923159
|
File details
Details for the file pypickle-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: pypickle-2.0.1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
894afd81d26443e8589d21361a3cc04bd9f5c1535aaa627c3bee1212b58bdf74
|
|
MD5 |
90824b8dc7116b269ada6876e7daf9cc
|
|
BLAKE2b-256 |
54447fa273d9bb6f4b67db104eb90c4ca66eb40cb692c5028c836f500d06364e
|