baybe.serialization.coreΒΆ

Converter and hooks.

Module Attributes

converter

The default converter for (de-)serializing BayBE-related objects.

Functions

add_type(hook)

Wrap a given hook to add type information to the unstructured object.

block_deserialization_hook(_, cls)

Prevent deserialization into a specific type.

block_serialization_hook(obj)

Prevent serialization of the passed object.

make_base_structure_hook(base)

Create a hook for structuring subclasses using annotations of their base class.

select_constructor_hook(specs, cls)

Use the constructor specified in the 'constructor' field for deserialization.

unstructure_with_type(x, /)

Unstructure an object and add its type information.