betty.porters.keyed_mapping module#
Keyed porters for portable mappings.
- final class betty.porters.keyed_mapping.KeyedMappingPorter#
Bases:
ProxyPorter,KeyedPorter,GenericMake an existing porter that dumps to portable mappings, a keyed porter.
- dump_keyed(data: DataT, /) tuple[str, PortableMapping]#
Dump the data to portable data and a portable primary key.
- Raises:
betty.portable.error.NotPortable – Raised if any part of the data is not portable.
- load_keyed(key: str, data: PortableData, /) DataT#
Create a new data instance from portable data and a portable primary key.
- Raises:
betty.exception.HumanFacingException – Raised if the portable data is invalid.