betty.porters.portable_record module

Porters for betty.datas.aggregate.record.PortableRecord types.

final class betty.porters.portable_record.PortableRecordPorter

Bases: PortablePorter[PortableRecordT, PortableData], RecordPorter, Generic

Expose a portable record data type as a porter.

dump_key(data: PortableRecordT, key: ElementT, /) tuple[str, PortableData]

Dump the data to portable data and a portable primary key.

load_key(portable: PortableData, key: ElementT, portable_key: str, /) PortableRecordT

Create a new data instance from portable data and a portable primary key.

Raises:

betty.exception.HumanFacingException – Raised if the portable data is invalid.