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.
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)¶
Check if the object can be serialized with a registered serializer.
- Parameters:
obj (Any) – Object to check
- Returns:
True if a serializer is available, False otherwise
- Return type:
- classmethod deserialize(data)¶
Deserialize an object using registered deserializers.
- Parameters:
data (Any) – Serialized data
- Returns:
Deserialized object
- Return type:
Any
- classmethod register(type_name, serializer, deserializer=None)¶
Register serializer and deserializer for a type.
- Parameters:
type_name (str) – Fully qualified type name
serializer (collections.abc.Callable) – Function to serialize objects of this type
deserializer (collections.abc.Callable | None) – Function to deserialize objects of this type
- classmethod serialize(obj)¶
Serialize an object using registered serializers.
- Parameters:
obj (Any) – Object to serialize
- Returns:
Serialized representation of the object
- Return type:
Any
- dataflow.serialization.deserialize_object(data)¶
Deserialize an object from stored data.