modelrunner.storage.backend.json module
Defines a class storing data in memory and writing it to a file in JSON format.
- class JSONStorage(path, *, mode='read', simplify=True, **kwargs)[source]
Bases:
TextStorageBaseStorage that stores data in a JSON text file.
Note that the data is only written once the storage is closed.
- Parameters:
path (str or
Path) – File path to the filemode (str or
AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.simplify (bool) – Flag indicating whether the data is stored in a simplified form