Vyaas Peraka
1 min readMay 12, 2020

Pickling & Unpickling in Python

The pickle module implements a fundamental, but powerful algorithm for serialising and de-serialising a Python object structure.

Pickling in python refers to the process of serializing objects into binary streams, while unpickling is the inverse of that. It's called that because of the pickle module in Python which implements the methods to do this.

Pickling is useful when you want to save the state of your objects and reuse them at another time without losing any instance specific data. If you are using large files, CPickle is recommended. CPickle is implemented in C making it much faster.

Pickling (Unpickling) is alternatively called as serialisation, marshalling or flattening.

To read data from a pickled file: