cadrumo.application.modelo.reconciliation_parsing module

Neutral parser boundary for modelo reconciliation evidence.

Application reconciliation consumes parsed filing observations. Inbound adapters own PDF extraction and bind one parser implementation at the executable host.

class ReconciliationCasillaObservation(*args, **kwargs)[source]

Bases: Protocol

The numeric-or-text casilla facts reconciliation reads from a PDF.

property casilla_id: str

Return the canonical casilla identifier.

property printed_value: object

Return the parsed printed value, if any.

property source_page: int

Return the one-based page carrying the observation.

property extraction_confidence: float

Return the parser’s bounded extraction confidence.

class ReconciliationDeclaracionObservation(*args, **kwargs)[source]

Bases: Protocol

Minimal filed-declaración observation consumed by reconciliation.

property modelo: str

Return the observed modelo code.

property period: Period

Return the observed filing period.

property ejercicio: str

Return the printed filing year.

property tax_id: str

Return the printed taxpayer identifier.

property values: Sequence[ReconciliationCasillaObservation]

Return the parsed casilla observations.

property extraction_profile_id: str

Return the registry extraction-profile identifier.

property extraction_profile_provisional: bool

Return whether the selected extraction profile is provisional.

class ReconciliationEvidenceParserPort(*args, **kwargs)[source]

Bases: Protocol

Inbound parsing capabilities required by reconciliation.

parse_justificante(source)[source]

Parse one local justificante PDF.

Return type:

Justificante

Parameters:

source (Path)

parse_justificante_bytes(source)[source]

Parse one in-memory justificante PDF.

Return type:

Justificante

Parameters:

source (bytes)

parse_declaracion(source, *, modelo, filing_year, period)[source]

Parse one local declaración PDF against its addressed work unit.

Return type:

ReconciliationDeclaracionObservation

Parameters:
parse_declaracion_bytes(source, *, modelo, filing_year, period, registry_snapshot)[source]

Parse decrypted declaration bytes against a validated snapshot.

Core types: RegistrySnapshot.

Return type:

ReconciliationDeclaracionObservation

Parameters:
bind_reconciliation_evidence_parser(parser)[source]

Bind the inbound parser implementation for one host lifetime.

Return type:

Generator[ReconciliationEvidenceParserPort]

Parameters:

parser (ReconciliationEvidenceParserPort)

reconciliation_evidence_parser()[source]

Resolve the explicitly composed reconciliation parser.

Return type:

ReconciliationEvidenceParserPort