This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from datetime import datetime | |
| def tomar_snapshot(conexion_db, query): | |
| """ | |
| Toma una instantánea congelada de una tabla dinámica. | |
| Args: | |
| conexion_db: conexión a la base de datos (ej: desde sqlalchemy) | |
| query: consulta SQL para extraer los datos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def xml_to_dataframe(file_path: str, registro_xpath: str, campos: Dict[str, str]) -> pd.DataFrame: | |
| """ | |
| Convierte un archivo XML a DataFrame. | |
| Parámetros: | |
| - file_path: ruta al archivo XML | |
| - registro_xpath: expresión XPath para encontrar cada registro (ej: './/prestamo') | |
| - campos: dict {nombre_columna: xpath_relativo} | |
| Retorna: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| gestion_incidencias.py - Detección y reporte de incidencias | |
| """ | |
| import pandas as pd | |
| # ============================================================ | |
| # 1. DETECTAR DUPLICADOS EN CLAVE PRIMARIA | |
| # ============================================================ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| analisis_migracion.py - Limpieza y transformación de datos | |
| """ | |
| import pandas as pd | |
| import numpy as np | |
| import unicodedata | |
| # ============================================================ | |
| # 1. NORMALIZACIÓN DE FECHAS (múltiples formatos → ISO) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| tests_migracion.py - Validación de migración de datos | |
| """ | |
| import pandas as pd | |
| import numpy as np | |
| # ============================================================ | |
| # 1. TEST DE INTEGRIDAD REFERENCIAL (sin huérfanos) | |
| # ============================================================ |