https://github.com/erdogant/pypickle
pypickle is for saving and loading files in pickle format.
https://github.com/erdogant/pypickle
load pickle pypi python python3 save
Last synced: 2 months ago
JSON representation
pypickle is for saving and loading files in pickle format.
- Host: GitHub
- URL: https://github.com/erdogant/pypickle
- Owner: erdogant
- License: other
- Created: 2020-07-10T18:07:52.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-08T13:49:46.000Z (6 months ago)
- Last Synced: 2025-04-12T06:15:07.234Z (6 months ago)
- Topics: load, pickle, pypi, python, python3, save
- Language: Python
- Homepage: https://erdogant.github.io/pypickle/
- Size: 3.25 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# pypickle
[](https://img.shields.io/pypi/pyversions/pypickle)
[](https://pypi.org/project/pypickle/)

[](https://github.com/erdogant/pypickle/blob/master/LICENSE)
[](https://pepy.tech/project/pypickle)
[](https://pepy.tech/project/pypickle/)
[](https://zenodo.org/badge/latestdoi/278702058)
[](https://erdogant.github.io/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**](https://erdogant.github.io/pypickle/pages/html/load.html) | Load your pickle files. |
| [**Save**](https://erdogant.github.io/pypickle/pages/html/save.html) | Save your files into pickle format. |
| [**is_critical_path**](https://erdogant.github.io/pypickle/pages/html/save.html#critical-system-paths) | Check whether filepath is critical. |
| [**get_critical_paths**](https://erdogant.github.io/pypickle/pages/html/save.html#critical-system-paths) | Get critical paths. |
| [**get_risk_modules**](https://erdogant.github.io/pypickle/pages/html/load.html#risk-modules) | Get risk modules. |
| [**get_allowed_paths**](https://erdogant.github.io/pypickle/pages/html/load.html) | 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](https://erdogant.github.io/pypickle/pages/html/save.html#security-mechanisms-save)) 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](https://erdogant.github.io/pypickle)
- **Bug Reports and Feature Requests:** [GitHub Issues](https://github.com/erdogant/pypickle/issues)---
##### Install pypickle from PyPI
```bash
pip install pypickle # normal install
pip install -U pypickle # update if needed
```#### Import pypickle package
```python
import pypickle
```#
#### [Example: Saving](https://erdogant.github.io/pypickle/pages/html/Save_and_Load.html#saving)
```python
import pypickle
filepath = 'test.pkl'# Some data
data = [1,2,3,4,5]# Save
status = pypickle.save(filepath, data)```
#
#### [Example: Loading](https://erdogant.github.io/pypickle/pages/html/Save_and_Load.html#loading)
```python
# Load file
data = pypickle.load(filepath)```
---
### Contributors
Special thanks to the contributors!### Maintainer
* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)
* Contributions are welcome.
* Yes! This library is entirely **free** but it runs on coffee! :) Feel free to support with a Coffee.[](https://www.buymeacoffee.com/erdogant)