Skip to content

Kropelki/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scripts

A collection of scripts useful for managing and syncing weather data for the Kropelki project.

/influxdb

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.

/jobs

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.

About

Miscellaneous and temporary data/files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published