betty.portable package¶
Submodules¶
Module contents¶
The portable data API.
Portable data can easily be persistent or transmitted across and between systems.
- final class betty.portable.CallbackPorter¶
-
Make data portable using a separate loader and dumper.
- __init__(loader: Callable[[PortableData], DataClsT], dumper: Callable[[DataClsT], PortableDataT], /)¶
- dump(data: DataClsT) PortableDataT¶
Dump data to its portable form.
- load(portable: PortableData) DataClsT¶
Load data from its portable form.
- final class betty.portable.OptionalPorter¶
Bases:
Porter[PortableT|None,PortableDataT|None],GenericAdd optional (
None) support to another porter.
- class betty.portable.Portable¶
-
A class that can be dumped to and loaded from portable data.
- abstractmethod dump() PortableDataT¶
Dump the instance to portable data.
- Raises:
betty.portable.error.NotPortable – Raised if any part of the data is not portable.
- abstractmethod classmethod load(portable: PortableData, /) Self¶
Create a new instance from portable data.
- Raises:
betty.exception.HumanFacingException – Raised if the portable data is invalid.
- class betty.portable.PortablePorter¶
-
Expose a portable data type as a porter.
- dump(data: PortableT) PortableDataT¶
Dump data to its portable form.
- load(portable: PortableData) PortableT¶
Load data from its portable form.
- class betty.portable.Porter¶
-
An object capable of dumping and loading data to and from portable data.
- copy(data: DataClsT) DataClsT¶
Deep-copy data into a new instance.
- abstractmethod dump(data: DataClsT, /) PortableDataT¶
Dump data to its portable form.
- abstractmethod load(portable: PortableData, /) DataClsT¶
Load data from its portable form.