A collection of scripts useful for managing and syncing weather data for the Kropelki project.
This directory contains a bash script that exports the last 30 days of data from InfluxDB into JSON files: influxdb/download-all-data.sh
.
All exported files are saved in the influxdb/.downloaded/
directory, with filenames based on their download dates. The most recent export is also copied to influxdb/.downloaded/latest.json
.
This directory contains a Python script that syncs weather data from JSON files (exported from InfluxDB) to a Turso database: jobs/sync-turso-with-influxdb.py
.
The script is structured as a Python package under jobs/sync_turso_with_influxdb/
, which provides modules for:
- Extracting weather data from JSON:
influx.py
- Generating SQL insert statements:
sql.py
- Sending data to Turso via HTTP API:
turso.py
- Utility functions for loading JSON data and resolving file paths:
utils.py
- Generating and saving diff reports:
report.py
Reports generated by the script are saved in the jobs/.reports/
directory.
jobs/.env
file should define the required env vars: TURSO_AUTH_TOKEN
and TURSO_DATABASE_URL
.