Metadata-Version: 2.1
Name: dataclass-persistence
Version: 0.0.10
Summary: This package enables to persist information stored in dataclasses.
Home-page: https://github.com/piveloper/dataclass-persistence
Author: piveloper
Author-email: piveloper@gmail.com
License: MIT
Description: 
        dataclass-persistence
        ==========================
        
        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
        
        
        Usage
        -----
        Let your dataclass inherit from :code:`PersistentDataclass`.
        Then the dataclass can be stored on disk using :code:`.store_to_disk()` and loaded from disk using
        :code:`.load_from_disk()`.
        
        In the example below, we create an instance of dataclass, which is stored to and loaded from disk.
        
        .. code-block:: python
        
            from dataclass_persistence import PersistentDataclass
            from dataclasses import dataclass
            import numpy as np
        
        
            @dataclass
            class SomeData(PersistentDataclass):
                parameter_a: str
                array: np.ndarray
        
        
            data = SomeData('my_string', np.array([0, 0]))
            file = 'my_file'
            data.store_to_disk(file)
            data_reconstructed = SomeData.load_from_disk(file)
        
        On disk the code above produces `my_file.zip` which contains `my_file.json`:
        
        .. code-block:: json
        
            {
              "parameter_a": "my_string",
              "array": {"data": [0, 0], "dtype": "int32"}
            }
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8.0
Description-Content-Type: text/x-rst
Provides-Extra: dev
