Spaces:
Sleeping
Sleeping
fix: add environment-aware logging with prod/dev/test levels and fix CSS not applying in Gradio 6
e60df7c Download src/config.py from kameshcodes/value-at-risk: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/spaces/kameshcodes/value-at-risk/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/kameshcodes/value-at-risk/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/kameshcodes/value-at-risk/resolve/main/src/config.py
672 Bytes
| """ | |
| 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"] | |