Skip to main content

Python with braces

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

restrictedpickle-0.3.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

restrictedpickle-0.3.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file restrictedpickle-0.3.0.tar.gz.

File metadata

  • Download URL: restrictedpickle-0.3.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for restrictedpickle-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d3dedc28145b1efec1d472751c56814c3b0795dcec20f1cc08137a4edb8c09f5
MD5 766dd0baedd67a4a7bb30cc8593091d4
BLAKE2b-256 e10dfe1875d702e72a7af2171f9f0733ac0680d4d295bbcb1abcbc7a0318ae79

See more details on using hashes here.

File details

Details for the file restrictedpickle-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for restrictedpickle-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d5a0b67c09dd5dc44d6b1ffdf39a7ed198a4550d0bdb72aa69c4cab3238393d
MD5 b90f8e0e811247e53f117c65aed6609c
BLAKE2b-256 88e08e0ebc29cb8f223f7967b11c1203b4e59ff15b506df2c8363420d1e3c39e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page