Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.0.16 instead.
Reason given by maintainers: No funciona. Contiene error.

Roche Data Chapter Team Library

Description

Una biblioteca modular en Python desarrollada para estandarizar y simplificar la creación de procesos ETL y automatizaciones. Pensada para equipos de datos que requieren integraciones con múltiples fuentes, soporte de logs y trazabilidad, y herramientas de administración de jobs SQL.

Características principales

🔌 Conectores de Base de Datos

  • Conexiones automáticas a SQL Server, Oracle, SAP HANA, MySQL, Snowflake y Redshift utilizando variables de entorno para parametrización segura.
  • Soporte de ejecución de consultas personalizadas y procedimientos almacenados.
  • Lectura directa a pandas.DataFrame o listas JSON.
  • Índice de funciones:
    • DbConfig.execute_custom_select_query: ejecuta consultas SELECT y devuelve resultados en DataFrame o JSON.
    • DbConfig.execute_stored_procedure: ejecuta procedimientos almacenados con parámetros tipados.
    • DbConfig.test_bind_connection: valida si un bind de conexión está disponible.

📊 Transformaciones de Datos

  • Conversión robusta de fechas, números, nulos y tipos de datos desde hojas de cálculo o APIs externas.
  • Estándares predefinidos para Google Sheets y Excel.
  • Índice de funciones:
    • DataTransformer.datestr_to_date: convierte texto a fecha según formato.
    • DataTransformer.date_to_str: convierte fecha a texto formateado.
    • DataTransformer.str_to_float: transforma texto numérico a float.
    • DataTransformer.str_to_int: transforma texto numérico a int.
    • DataTransformer.nan_to_none: normaliza valores vacíos (NaN/cadena vacía) a None.
    • DataTransformer.gsheet_days_since_to_date: convierte serial de fecha de Google Sheets a datetime.

📤 Google API Services

  • Lectura/escritura en hojas de Google Sheets.
  • Carga y descarga de archivos desde Google Drive.
  • Manejo de credenciales OAuth2 y reintentos automáticos.
  • Índice de funciones:
    • GoogleServices.read_gsheet_data: lee datos de Google Sheets a DataFrame o JSON.
    • GoogleServices.write_gsheet_data: escribe un DataFrame en un rango de Google Sheets.
    • GoogleServices.upload_file_to_drive: sube archivos a una carpeta de Google Drive.
    • GoogleServices.read_excel_data_from_google_drive: descarga y lee archivos Excel desde Drive.
    • GoogleServices.read_csv_data_from_google_drive: descarga y lee archivos CSV desde Drive.
    • GoogleServices.retry_request: reintenta solicitudes ante errores transitorios.

📩 Email Automation con AppSheet

  • Gestión automatizada del envío de emails usando AppSheet como backend.
  • Soporte para archivos adjuntos en Google Drive (PDF, Excel, TXT).
  • Índice de funciones:
    • EmailService.send_email: arma y registra el envío de correo en AppSheet.
    • EmailService.get_email_register_to_and_cc_and_bcc: obtiene destinatarios configurados por sysname.
    • AppsheetService.add_registers_to_table: inserta registros en tablas de AppSheet.
    • GoogleServices.upload_file_to_drive: carga adjuntos a Drive para su referencia en el correo.

📁 Generación de Excel

  • Creación de archivos Excel multiformato con estilo, desde múltiples DataFrame.
  • Ancho de columnas y formatos aplicados automáticamente.
  • Índice de funciones:
    • ExcelFile.append_sheet_from_df: agrega hojas al archivo desde DataFrames.
    • ExcelFile.save: genera y guarda el archivo Excel final.
    • ExcelFile._format_workbook: aplica estilos, bordes y autoajuste de columnas.

📅 SQL Server Agent Job Manager

  • Creación, actualización y administración de SQL Jobs directamente desde Python.
  • Utilidad especialmente útil para entornos corporativos que ejecutan ETLs como tareas programadas.
  • Índice de funciones:
    • JobManager.create_python_job: crea jobs de SQL Server Agent con paso inicial de ejecución.
    • JobManager.update_python_job: actualiza owner y comando de un job existente.
    • JobManager.get_job_id_by_job_name: busca el identificador del job por nombre.

📑 Logging persistente

  • Sistema de log en archivos .log y persistencia opcional en base de datos.
  • Integrado con JobExecution y JobExecutionLog.
  • Índice de funciones:
    • Logger.info: registra eventos informativos en archivo y opcionalmente en BD.
    • Logger.warning: registra advertencias operativas.
    • Logger.error: registra errores del proceso.
    • Logger._log_to_db: persiste cada evento de log en tablas de ejecución.
    • LoggerSingleton.init: inicializa una instancia global reutilizable del logger.

Usage

Está pensada para ser utilizado como requisito en cualquier proyecto ETL en Python.

Support

Authors and acknowledgment

Lucas Frías (lucas.frias@roche.com) Uciel Bustamante (uciel.bustamante@contractors.roche.com)

Metadata

Release files for roche-datachapter-team-lib 0.0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roche-datachapter-team-lib 0.0.15
File Size Uploaded
roche_datachapter_team_lib-0.0.15.tar.gz 30.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for roche-datachapter-team-lib 0.0.15
File Interpreter ABI Platform
roche_datachapter_team_lib-0.0.15-py3-none-any.whl Python 3 none any Details

Total release size: 56.7 kB

Release files / roche_datachapter_team_lib-0.0.15.tar.gz

Download URL roche_datachapter_team_lib-0.0.15.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
be21c3a373e9e5a9d0c8370fcc1afb31fcc416a3f30febc5502f7b6773983633
BLAKE2b-256 checksum
How to use checksums
72d1eb6f67636e9ea0cf7b156ebe1acd9b39b6b2e7b46472bba2ac0407d4c88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.1

Release files / roche_datachapter_team_lib-0.0.15-py3-none-any.whl

Download URL roche_datachapter_team_lib-0.0.15-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d5e763983ccb5e10ac5905cf56fde813711f63a101582560984ccd482fb7680
BLAKE2b-256 checksum
How to use checksums
95d37ff835d256d7388e6f57f9e029981d2e202fccd77a9494bcf7961f72917f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.1

Release history Release notifications | RSS feed

0.0.16

2 release files

This release

0.0.15 This release

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page