findmy.util.files#

Utilities to simplify reading and writing data from and to files.

Functions#

save_and_return_json(→ _T)

Save and return a JSON-serializable data structure.

read_data_json(→ _T)

Read JSON data from a file if a path is passed, or return the argument itself.

Module Contents#

findmy.util.files.save_and_return_json(data: _T, dst: str | pathlib.Path | None) _T#

Save and return a JSON-serializable data structure.

findmy.util.files.read_data_json(val: str | pathlib.Path | _T) _T#

Read JSON data from a file if a path is passed, or return the argument itself.