File size: 672 Bytes
7bb0af0
 
 
 
 
 
 
e60df7c
7bb0af0
 
 
 
 
 
 
 
 
e60df7c
7bb0af0
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
config.py -- Load application configuration from config.yaml.

Usage:
    from src.config import TICKERS, LOOKBACK_DAYS, STRESS_LABEL, STRESS_START_DATE, STRESS_END_DATE
"""

import os
from pathlib import Path

import yaml

_CONFIG_PATH = Path(__file__).resolve().parent.parent / "config.yaml"

with open(_CONFIG_PATH) as _f:
    _cfg = yaml.safe_load(_f)

ENV: str = os.environ.get("ENV", _cfg.get("env", "dev")).lower()
TICKERS: list[str] = _cfg["tickers"]
LOOKBACK_DAYS: int = _cfg["lookback_days"]
STRESS_LABEL: str = _cfg["stressed_period_label"]
STRESS_START_DATE: str = _cfg["stressed_period_start_date"]
STRESS_END_DATE: str = _cfg["stressed_period_end_date"]