betty.portable package¶
Submodules¶
Module contents¶
The portable data API.
Portable data can easily be persistent or transmitted across and between systems.
- 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.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.