deepcave.utils.compression¶
# Compression
This module provides utilities for serializing and deserializing a dataframe from/to a string.
- ## Classes
Encoder: This class defines a custom JSON Encoder.
- ## Constants
JSON_DENSE_SEPARATORS: Tuple(str, str)
JSON_DEFAULT_SEPARATORS: Tuple(str, str)
TYPE: TypeVar
Functions
|
Deserialize a dataframe from a string. |
|
Serialize a dataframe to a string. |
Classes
|
Define a custom JSON Encoder. |
- class deepcave.utils.compression.Encoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoder
Define a custom JSON Encoder.
- deepcave.utils.compression.deserialize(string, dtype=<class 'pandas.core.frame.DataFrame'>)[source]¶
Deserialize a dataframe from a string.
- Parameters:
string (str) – The string to be deserialized.
dtype (TYPE, optional) – The type of the object. Default is pd.DataFrame.
- Returns:
The deserialized object.
- Return type:
TYPE