A script that fetches the exchange rates (USD base) from OpenExchangeRate and sends an email notification if the rate is above the defined threshold for the given currencies.
The script runs on a defined scheduled GitHub Actions workflow (in theory, but it will never be on the exact defined timing, see here for more information).
Note: This script was tested and used with Python 3.12
- Sign up at OpenExchangeRate to get an APP ID (free plan is enough).
- Create a
.env
file based on the sample. - Run the script as specified below in
Run
step.
- Sign up at OpenExchangeRate to get an APP ID (free plan is enough).
- Create a GitHub Actions repository secret named
ENV_FILE_CONTENT
and populate it with the same content as in the sample file (.env.sample
). - Create a GitHub Actions repository secret named
THRESHOLD_RATE
and populate it (only reason why this is separate from the above secret is because it changes quite frequently, you don't have to grab all the other values to adjust the threshold). - Either run manually or wait until scheduled time.
Setup and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Run the script:
python src/script.py
Format:
make format
Lint:
make lint