-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (31 loc) · 1.37 KB
/
config.py
File metadata and controls
38 lines (31 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
from dotenv import load_dotenv
load_dotenv()
# --- Exchange Rate API Configurations ---
# These variables are related to fetching exchange rates.
EXCHANGE_API_KEY = os.getenv("EXCHANGE_RATE_API_KEY")
EXCHANGE_RATE_BASE_CURRENCY = os.getenv("EXCHANGE_RATE_BASE_CURRENCY")
EXCHANGE_RATE_TARGET_CURRENCY = os.getenv("EXCHANGE_RATE_TARGET_CURRENCY")
# Construct the full API URL after loading its components
# The f-string ensures the API key and base currency are integrated correctly.
EXCHANGE_RATE_API_BASE = os.getenv(
"EXCHANGE_RATE_API_BASE", "https://v6.exchangerate-api.com/v6"
)
EXCHANGE_API_URL = (
f"{EXCHANGE_RATE_API_BASE}/{EXCHANGE_API_KEY}/latest/{EXCHANGE_RATE_BASE_CURRENCY}"
)
# --- Email (SMTP) Configurations ---
# These variables are for sending emails via an SMTP server.
SMTP_SERVER = os.getenv("SMTP_SERVER")
SMTP_PORT = os.getenv("SMTP_PORT")
EMAIL_SENDER = os.getenv("EMAIL_SENDER")
EMAIL_HOST = os.getenv("EMAIL_HOST")
EMAIL_PORT = os.getenv("EMAIL_PORT")
EMAIL_PASSWORD = os.getenv("EMAIL_PASSWORD")
EMAIL_RECIPIENT = os.getenv("EMAIL_RECIPIENT")
# --- Application Specific Constants ---
# This variable appears to be a general application threshold.
THRESHOLD = float(os.getenv("THRESHOLD"))
# --- Scheduler Configuration ---
# This variable defines the time at which the daily job should run.
RUN_TIME = os.getenv("RUN_TIME", "09:00") # Default to