lisc.io.io.save_object

lisc.io.io.save_object(obj, file_name, directory=None)[source]

Save a custom object as a pickle file.

Parameters
objCounts or Words

Object to save out.

file_namestr

Name for the file to be saved out.

directorystr or Path or SCDB, optional

Folder or database object specifying the save location.

Examples

Save a Counts object, using a temporary directory:

>>> from tempfile import TemporaryDirectory
>>> from lisc.objects import Counts
>>> with TemporaryDirectory() as dirpath:
...     save_object(Counts(), 'counts.p', directory=dirpath)