dataflow.serialization¶
Serialization utilities for the Haive Registry System.
This module provides tools for serializing and deserializing complex Python objects for storage in the registry database.
Attributes¶
Classes¶
Registry for serializers and deserializers. |
Functions¶
|
Deserialize an object from stored data. |
|
Serialize an object to a format suitable for storage. |
Module Contents¶
- class dataflow.serialization.SerializationRegistry¶
Registry for serializers and deserializers.
This registry allows the system to handle complex Python objects by registering custom serializers and deserializers for specific types.
- classmethod can_serialize(obj: Any) bool¶
Check if the object can be serialized with a registered serializer.
- Parameters:
obj – Object to check
- Returns:
True if a serializer is available, False otherwise
- classmethod deserialize(data: Any) Any¶
Deserialize an object using registered deserializers.
- Parameters:
data – Serialized data
- Returns:
Deserialized object
- classmethod register(type_name: str, serializer: collections.abc.Callable, deserializer: collections.abc.Callable | None = None)¶
Register serializer and deserializer for a type.
- Parameters:
type_name – Fully qualified type name
serializer – Function to serialize objects of this type
deserializer – Function to deserialize objects of this type
- classmethod serialize(obj: Any) Any¶
Serialize an object using registered serializers.
- Parameters:
obj – Object to serialize
- Returns:
Serialized representation of the object
- dataflow.serialization.deserialize_object(data: dict[str, Any]) Any¶
Deserialize an object from stored data.
- Parameters:
data – Serialized representation
- Returns:
Deserialized object
- dataflow.serialization.serialize_object(obj: Any) dict[str, Any]¶
Serialize an object to a format suitable for storage.
- Parameters:
obj – Object to serialize
- Returns:
Serialized representation as a JSON-compatible dict
- dataflow.serialization.logger¶