ips_etl/settings.py

21 lines
515 B
Python

from dataclasses import dataclass, field
import os
from environs import load_dotenv
from typing import List
load_dotenv()
@dataclass
class ApiConfig:
host: str = os.getenv('API_HOST')
token: str = os.getenv('API_TOKEN')
iblocks: List[str] = field(default_factory=lambda: os.getenv('IBLOCKS').split(','))
@dataclass
class EtlConfig:
host: str = os.environ.get('DESTINATION_HOST')
port: int = int(os.environ.get('DESTINATION_PORT'))
protocol: str = os.environ.get('DESTINATION_PROTOCOL')