Files
descarga_factura_transporte/config_loader.py
T
2026-06-01 16:31:24 -05:00

22 lines
606 B
Python

import json
from pathlib import Path
from config_model import Config, HanaConfig, OutlookConfig, ClientConfig
########################################################
CONFIG_PATH = Path(__file__).resolve().parent / "config.json"
with open(CONFIG_PATH, 'r', encoding='utf-8') as f:
data = json.load(f)
# Instantiate dataclasses
hana = HanaConfig(**data.get('hana', {}))
outlook = OutlookConfig(**data.get('outlook', {}))
client = ClientConfig(**data.get('client', {}))
CONFIG = Config(
hana=hana,
outlook=outlook,
client=client
)
########################################################