aeat.domain.calculations.registry._export_parse module

Parse AEAT filed/exported declaration payloads through registry layouts.

class ParsedExportFieldValue(**data)[source]

Bases: RegistryModel

One field value read from an AEAT payload using a registry export field.

Parameters:
  • record_id (RecordId)

  • field_id (ExportFieldId)

  • casilla_id (CasillaId | None)

  • binding_id (BindingId | None)

  • raw (str)

  • value (Decimal | str | bool | None)

  • source_locator (str)

record_id: RecordId
field_id: ExportFieldId
casilla_id: CasillaId | None
binding_id: BindingId | None
raw: str
value: Decimal | str | bool | None
source_locator: str
class ParsedExportPayload(**data)[source]

Bases: RegistryModel

Casilla and field values parsed from a complete registry export layout.

Parameters:
layout_id: ExportLayoutId
fields: tuple[ParsedExportFieldValue, ...]
casillas: tuple[ParsedExportFieldValue, ...]
class XmlDictionaryEntry(field_id, path, data_type, casilla_id)[source]

Bases: object

One field mapping from an official AEAT XML dictionary source.

Parameters:
  • field_id (str)

  • path (str)

  • data_type (str)

  • casilla_id (CasillaId | None)

field_id: str
path: str
data_type: str
casilla_id: TypeAliasType | None
parse_export_payload(layout, payload, *, source_root=None, sources=None)[source]

Parse a complete AEAT payload and return a ParsedExportPayload.

Return type:

ParsedExportPayload

Parameters:
xml_dictionary_entries(layout, *, source_root, sources)[source]

Resolve official AEAT XML dictionary XmlDictionaryEntry rows for layout.

Return type:

tuple[XmlDictionaryEntry, ...]

Parameters: