niolabs / safepickle

Provides an alternative to using Python's unsafe pickle module
Apache License 2.0
1 stars 1 forks source link

safepickle

A safe alternative to Python's pickle module.

Installation

pip install safepickle

Usage

Safepickle is designed to be used as a drop-in replacement wherever you currently use the pickle module. So in your code you can just import safepickle instead.

import safepickle as pickle

obj = {'loves pickles': True}
obj_str = pickle.dumps(obj)
obj_again = pickle.loads(obj_str)

assert obj_again == obj