This repository has been archived on 2026-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
Andrey Epifancev 2da7bff71a test: golden на обезличенных входах aep_3, склейки, блока «Коды» 1С и листа-продолжения НПЗ; публичный API
Пять golden-входов по Review Focus 1–5, эталоны, свойство status_input_from_contract(to_contract(d)) == status_input(d)
на golden и граничных кейсах (DISCLOSURE, без строк, абсолютная колонка без даты), test_public_api, RulesError в __all__,
README: публичный API, словари, golden-update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJKMLHdxMwSUeYcdkwqX4W
2026-10-18 14:12:29 +04:00

140 lines
3.4 KiB
Python

"""Общий код нормализации форм ББ/ОФР.
Публичный API — только имена `__all__` (раздел «Публичный API пакета» плана 1). Контрактные имена — `contract.py`.
"""
from arm_statements.amounts import parse_amount
from arm_statements.codes import parse_code, sheet_joins
from arm_statements.columns import amount_columns
from arm_statements.contract import status_input_from_contract, to_contract, warning_to_contract
from arm_statements.dates import parse_date, resolve_relative
from arm_statements.header import continuation_type, is_continuation, parse_header, type_hint
from arm_statements.issues import WarningCode, make_warning
from arm_statements.layout import code_column
from arm_statements.loader import Rules, RulesError, default_rules, load_rules
from arm_statements.model import (
HEADER_FIELDS,
CandidateResult,
Cell,
CellValue,
DateField,
DocStatus,
DocumentType,
Edition,
EnvelopeStatus,
Evidence,
FailedRelation,
FormCandidate,
FormVariant,
HeaderCells,
HeaderField,
LineStatus,
NormalizationResult,
PeriodKind,
Severity,
SignForm,
Source,
StatementChecks,
StatementColumn,
StatementDocument,
StatementHeader,
StatementLine,
StatementValue,
StatementWarning,
)
from arm_statements.pipeline import normalize, normalize_candidate
from arm_statements.recompute import (
RecomputeResult,
StoredColumn,
StoredForm,
StoredLine,
StoredValue,
StoredWarning,
recompute,
)
from arm_statements.serialize import candidate_from_dict, to_jsonable
from arm_statements.status import (
StatusInput,
StatusLine,
StatusValue,
document_status,
envelope_status,
status_input,
)
from arm_statements.structure import choose_edition
from arm_statements.text import fix_lookalikes, normalize_caption, normalize_label
from arm_statements.version import statements_version
__all__ = [
"HEADER_FIELDS",
"CandidateResult",
"Cell",
"CellValue",
"DateField",
"DocStatus",
"DocumentType",
"Edition",
"EnvelopeStatus",
"Evidence",
"FailedRelation",
"FormCandidate",
"FormVariant",
"HeaderCells",
"HeaderField",
"LineStatus",
"NormalizationResult",
"PeriodKind",
"RecomputeResult",
"Rules",
"RulesError",
"Severity",
"SignForm",
"Source",
"StatementChecks",
"StatementColumn",
"StatementDocument",
"StatementHeader",
"StatementLine",
"StatementValue",
"StatementWarning",
"StoredColumn",
"StoredForm",
"StoredLine",
"StoredValue",
"StoredWarning",
"StatusInput",
"StatusLine",
"StatusValue",
"WarningCode",
"amount_columns",
"candidate_from_dict",
"choose_edition",
"code_column",
"continuation_type",
"default_rules",
"document_status",
"envelope_status",
"fix_lookalikes",
"is_continuation",
"load_rules",
"make_warning",
"normalize",
"normalize_candidate",
"normalize_caption",
"normalize_label",
"parse_amount",
"parse_code",
"parse_date",
"parse_header",
"recompute",
"resolve_relative",
"sheet_joins",
"statements_version",
"status_input",
"status_input_from_contract",
"to_contract",
"to_jsonable",
"type_hint",
"warning_to_contract",
]