foamyguy_nvm_helper

Easy interface to store and retrieve objects persisted via NVM. First 4 bytes are an int that contains the total size of bytes stored in nvm. Remaining space used to store data packed with msgpack.pack()

  • Author(s): Tim Cocks

Implementation Notes

Hardware:

Software and Dependencies:

foamyguy_nvm_helper.read_data(verbose: bool = False) Union[object, list, dict, int, float, str]
Parameters

verbose (bool) – Informative prints about reading and unpacking the data.

Returns

The data object that was saved with save_data().

foamyguy_nvm_helper.save_data(data: Union[object, list, dict, int, float, str], test_run: bool = True, verbose: bool = False) None

Save arbitrary data objects to persist in nvm storage.

Parameters
  • data (Union[list, dict, int, float, str]) – The data to save in nvm.

  • test_run (bool) – True will process data, but not save it to nvm. Set False to save the data.

  • verbose (bool) – Informative prints about packaging and saving the data.

Returns

None