65 lines
1.7 KiB
Python
65 lines
1.7 KiB
Python
"""Limpieza de CSV con análisis inteligente local y reglas configurables.
|
|
|
|
API pública (estable):
|
|
- ``analyze_dataframe`` — resumen por columna
|
|
- ``CLEANING_RULES`` / ``register_rule`` / ``get_rule`` — catálogo de reglas
|
|
- ``apply_rules`` — aplica reglas por columna
|
|
- ``load_csv`` / ``load_csv_bytes`` / ``detect_delimiter`` — I/O
|
|
|
|
Para agregar una regla nueva, ver ``rules/registry.py`` y ``rules/builtins.py``.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from .analyze import analyze_dataframe, sample_dataframe_rows
|
|
from .apply import apply_rules
|
|
from .cop_mod import (
|
|
DEFAULT_MODERADORA_BY_YEAR,
|
|
merge_moderadora_config,
|
|
normalize_moderadora_by_year_dict,
|
|
)
|
|
from .documents import homologate_doc_type, split_doc_tipo_y_numero_texto
|
|
from .io import detect_delimiter, load_csv, load_csv_bytes
|
|
from .models import (
|
|
TYPE_BOOLEAN,
|
|
TYPE_CATEGORICAL,
|
|
TYPE_DATE,
|
|
TYPE_DECIMAL,
|
|
TYPE_EMPTY,
|
|
TYPE_INTEGER,
|
|
TYPE_MIXED,
|
|
TYPE_TEXT,
|
|
ColumnSummary,
|
|
)
|
|
from .notas import extract_autorizacion_nota, extract_paciente_documento_nota
|
|
from .rules import CLEANING_RULES, get_rule, register_rule
|
|
from .type_inference import applicable_rule_ids_for_type
|
|
|
|
__all__ = [
|
|
"CLEANING_RULES",
|
|
"ColumnSummary",
|
|
"DEFAULT_MODERADORA_BY_YEAR",
|
|
"TYPE_BOOLEAN",
|
|
"TYPE_CATEGORICAL",
|
|
"TYPE_DATE",
|
|
"TYPE_DECIMAL",
|
|
"TYPE_EMPTY",
|
|
"TYPE_INTEGER",
|
|
"TYPE_MIXED",
|
|
"TYPE_TEXT",
|
|
"analyze_dataframe",
|
|
"applicable_rule_ids_for_type",
|
|
"apply_rules",
|
|
"detect_delimiter",
|
|
"extract_autorizacion_nota",
|
|
"extract_paciente_documento_nota",
|
|
"get_rule",
|
|
"homologate_doc_type",
|
|
"load_csv",
|
|
"load_csv_bytes",
|
|
"merge_moderadora_config",
|
|
"normalize_moderadora_by_year_dict",
|
|
"register_rule",
|
|
"sample_dataframe_rows",
|
|
"split_doc_tipo_y_numero_texto",
|
|
]
|