cf.unpickle

cf.unpickle(filename)[source]

Return the reconstituted (unpickled) object from a binary pickle file.

Any binary pickle file may be used as input.

The unpickling is equivalent to:

import cPickle
fh = open('file.pkl', 'rb')
x = cPickle.load(fh)
fh.close()
Parameters:
filename: str

The name of the file containing the pickled object.

Returns:
out:

The reconstituted object.

Raises:
UnpicklingError:

If the file can not be unpickled. In particular, this might be raised when attempting to unpickle fields which were pickled with a different, incompatible version of cf.

See also

cf.pickle

Examples:

For any picklable object, x:

>>> cf.pickle(x, 'file.pkl')
>>> y = cf.unpickle('file.pkl')
>>> cf.equals(x, y)
True