🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

pypickle

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pypickle

pypickle is a Python library to save and load variables in pickle files.

1.1.5
PyPI
Maintainers
1

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

FeatureDescription
LoadLoad your pickle files.
SaveSave your files into pickle format.
is_critical_pathCheck whether filepath is critical.
get_critical_pathsGet critical paths.
get_risk_modulesGet risk modules.
get_allowed_pathsGet 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 TypeAllowed?How to Change Behavior
UnknownAllowed unless in high-risk list
Custom safeIf included in validate param
Risky (os, etc.)Must be explicitly added via validate=['nt'] or validate=False
  • 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

  • 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.

Keywords

Python

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts