Retrieve DTE outage data.
// readme
dte-outage-tracker
Retrieve DTE outage data.
Retrieving historical data
The main.mjs script runs every hour on GitHub Actions.
- The script retrieves high-level data from the internal DTE Kubra API and writes to
data-api.json. - The script also retrieves high-level data from the external-facing DTE dashboard and writes to
data-home.json. - In addition, the script writes to
data.csvwith more granular Kubra data based on ZIP Code.
The script overwrites these files on each run, but we are still able to retrieve historical data based on Git commit history using the git-history package authored by Simon Willison.
Setup
- Run
python3 -m venv venvto create a virtual environment. - Run
source venv/bin/activateto activate the virtual environment. - Run
pip install -r requirements.txtto install dependencies.
Scripts
- Run
./data-api.shto generate a SQL database atdata-api.sqliteof historical data based ondata-api.jsoncommit history. - Run
./data-home.shto generate a SQL database at…