pickle

import pickle

pickle is used to serialize and deserialize python objects.

some_object = {'title':'Dunkirk', 'length':'1:46', 'certificate':'12A'}
pickle.dump(some_object, open('movie.pkl', 'wb'))
pickle.load(open('movie.pkl', 'rb'))

If you spot any errors please let me know on twitter.