This program can be used to make dataclasses persistent by adding store and load functionality. The dataclass is stored in .json format which is by default compressed inside of a .zip file.
- What makes dataclass-persistence special?
-
- Support for numpy arrays
- Support for nested dataclasses
- Human readable storage format with small file size
Let your dataclass inherit from Persistent
. Then the dataclass can be stored on disk using .store()
and loaded from disk using .load()
.
In the example below, we create an instance of dataclass, which is stored to and loaded from disk.
On disk the code above produces my_file.zip which contains `my_file.json`: