Spaces:
Sleeping
Sleeping
Download config.py from Shivam4096/Financial2API: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/spaces/Shivam4096/Financial2API/resolve/main/config.py
- Command line
-
hf download hf://spaces/Shivam4096/Financial2API/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Shivam4096/Financial2API/resolve/main/config.py
1.81 kB
| """ | |
| config.py -- App-wide constants and environment loading. | |
| """ | |
| import os | |
| from pathlib import Path | |
| from dotenv import load_dotenv | |
| # Load .env from the app root | |
| _ENV_PATH = Path(__file__).parent / ".env" | |
| load_dotenv(_ENV_PATH) | |
| # -- API Keys ------------------------------------------------------------------ | |
| FMP_API_KEY: str = os.environ.get("FMP_API_KEY", "") | |
| GEMINI_API_KEY: str = os.environ.get("GEMINI_API_KEY", "") | |
| CLAUDE_API_KEY: str = os.environ.get("CLAUDE_API_KEY", "") | |
| OPENAI_API_KEY: str = os.environ.get("OPENAI_API_KEY", "") | |
| GROQ_API_KEY: str = os.environ.get("GROQ_API_KEY", "") | |
| NVIDIA_API_KEY: str = os.environ.get("NVIDIA_API_KEY", "") | |
| HF_API_KEY: str = os.environ.get("HF_API_KEY", "") | |
| # -- Data settings ------------------------------------------------------------- | |
| DEFAULT_YEARS: int = 5 | |
| CACHE_TTL_DAYS: int = 7 # days before cached data expires | |
| FMP_BASE: str = "https://financialmodelingprep.com/api" | |
| SCREENER_BASE: str = "https://screener.in/company" | |
| REQUEST_TIMEOUT: int = 20 | |
| # -- Output -------------------------------------------------------------------- | |
| OUTPUT_DIR: Path = Path(__file__).parent / "outputs" | |
| OUTPUT_DIR.mkdir(exist_ok=True) | |
| DB_PATH: Path = Path(__file__).parent / "storage" / "history.db" | |
| DB_PATH.parent.mkdir(exist_ok=True) | |
| # -- AI Models ----------------------------------------------------------------- | |
| GEMINI_MODEL: str = "gemini-2.0-flash" | |
| CLAUDE_MODEL: str = "claude-3-5-haiku-20241022" | |
| OPENAI_MODEL: str = "gpt-4o-mini" | |
| GROQ_MODEL: str = "llama-3.3-70b-versatile" # free, high-quality | |
| NVIDIA_MODEL: str = "meta/llama-3.1-405b-instruct" | |
| # -- App metadata -------------------------------------------------------------- | |
| APP_NAME: str = "Financial Analyzer" | |
| APP_VERSION: str = "1.0.0" | |