aeat.adapters.inbound.declaracion package¶
Public parsing boundary for filed declaration PDFs.
The package exposes parse_declaracion() for filesystem PDF input and
parse_declaracion_bytes() for in-memory or decrypted PDF bytes. Both entry
points return InboundDeclaracionObservation records interpreted through a
validated RegistrySnapshot.
Parsing resolves TemplateRevision and period, selects one
ExtractionProfileDefinition with
surface == "declaracion_pdf" and accepted artefact kind
"declaration_pdf", and extracts filed-declaration casilla values. Without
an explicit profile id, registry profile selection must find exactly one match.
Returned observations stamp a re-resolvable
RegistrySnapshotRef,
privacy-preserving source reference, and SHA-256. They are observations, not
calculation authority; filing workflow, persistence, tax-law classification,
and CLI presentation live outside inbound parsing.
Template detection resolves identity only; registry validation and profile
choice happen in the parser. This boundary is distinct from
borrador, which parses Renta draft PDFs, and
justificante, which parses receipt metadata.
Successful parses currently return warnings=(). ExtractionWarning
remains public, while malformed, ambiguous, or low-coverage extraction raises
DeclaracionParseError; missing template identity raises
TemplateNotDetectedError.
Public API:
from aeat.adapters.inbound.declaracion import (
InboundDeclaracionObservation,
DeclaracionParseError,
ExtractionWarning,
TemplateNotDetectedError,
TemplateRevision,
parse_declaracion,
parse_declaracion_bytes,
)
See also
parse_declaracion()Filesystem entry point for declaration-copy PDFs.
parse_declaracion_bytes()In-memory entry point used by live-read flows that already hold decrypted PDF bytes.
ExtractionProfileDefinitionRegistry-owned extraction contract consumed by this parser.
Subpackages¶
Submodules¶
- aeat.adapters.inbound.declaracion._detect module
- aeat.adapters.inbound.declaracion._errors module
- aeat.adapters.inbound.declaracion._parser module
- aeat.adapters.inbound.declaracion._schema module
TemplateRevisionExtractionWarningInboundDeclaracionObservationInboundDeclaracionObservation.modeloInboundDeclaracionObservation.ejercicioInboundDeclaracionObservation.periodInboundDeclaracionObservation.tax_idInboundDeclaracionObservation.template_revisionInboundDeclaracionObservation.registry_snapshot_refInboundDeclaracionObservation.valuesInboundDeclaracionObservation.warningsInboundDeclaracionObservation.extraction_profile_idInboundDeclaracionObservation.extraction_profile_provisionalInboundDeclaracionObservation.source_pdf_pathInboundDeclaracionObservation.source_pdf_sha256InboundDeclaracionObservation.parsed_at