Skip to main content

restrictedpickle - Safe Pickle for Python

This is a safe version of Python's pickle module. It will only pickle and unpickle safe tyes like int, float, str, list, dict, etc. It will not unpickle malicious code. It is safe to use restrictedpickle on untrusted data.

This module is compatible standard pickle module. You can use restrictedpickle as a drop-in replacement for pickle.

Installation

pip install restrictedpickle

Usage

import restrictedpickle.classic as pickle

data = {'a': 1, 'b': 2}
data_serialized = pickle.dumps(data)
data_unserialized = pickle.loads(data_serialized)
assert data == data_unserialized

Release files for restrictedpickle 0.3.0

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

Source distribution (sdist)

Source distribution for restrictedpickle 0.3.0
File Size Uploaded
restrictedpickle-0.3.0.tar.gz 14.0 kB Details

Built distribution (wheel)

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

Total release size: 28.8 kB

Release files / restrictedpickle-0.3.0.tar.gz

Download URL restrictedpickle-0.3.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d3dedc28145b1efec1d472751c56814c3b0795dcec20f1cc08137a4edb8c09f5
BLAKE2b-256 checksum
How to use checksums
e10dfe1875d702e72a7af2171f9f0733ac0680d4d295bbcb1abcbc7a0318ae79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / restrictedpickle-0.3.0-py3-none-any.whl

Download URL restrictedpickle-0.3.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d5a0b67c09dd5dc44d6b1ffdf39a7ed198a4550d0bdb72aa69c4cab3238393d
BLAKE2b-256 checksum
How to use checksums
88e08e0ebc29cb8f223f7967b11c1203b4e59ff15b506df2c8363420d1e3c39e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

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