call_report.fca.DomainDatasetCode#

class call_report.fca.DomainDatasetCode(*, code: int, label: str, is_total: bool, components: tuple[int, ...] = ())[source]#

Bases: object

One row key value in a curated domain dataset.

The codes are the source’s own, not a numbering this package invents, so a value here can be matched against the raw file. label is the curation, giving each code a name a reader does not have to look up. A code declaring components is the one exception: it is computed from other codes rather than reported, so its number is chosen here and will not be found in the raw file.

Attributes:
codeint

The code identifying this row, in the source schedule’s own vocabulary, or a number this package chooses for a code that declares components.

labelstr

A human-readable name for what code identifies.

is_totalbool

Whether this code is a subtotal rather than a distinct member of the breakdown. A caller summing over codes has to exclude these, which FCACallReport.to_domain_dataset does by default.

componentstuple[int, …]

The codes this one is summed from, for a subtotal the source leaves a reader to compute. The member codes stay in the result alongside it. Empty for a code the source reports itself.

Examples

>>> from call_report.fca._domain_datasets import DomainDatasetCode
>>> agribusiness = DomainDatasetCode(code=110, label="Agribusiness", is_total=False)
>>> agribusiness.label
'Agribusiness'