This folder contains a sample application that demonstrates how users might choose to collect air quality information. We leverage the Open AQ Platform API (https://docs.openaq.org/) to collect and store data in TimescaleDB.
- A working instance of TimescaleDB
- Python3 environment
- Install python dependencies with
pip3 install -r requirements.txt
The files in this directory and how they're used:
airquality_ingest.py
: Python script to read data from Open AQ Platform API and insert them into TimescaleDB.schema.sql
: Data definition (DDL) to create the necessary tables & hypertables.grafana.json
: Grafana dashboard configuration.requirements.txt
: Python dependency requirements.sample.json
: Sample json output from the Open AQ Platform API.
- Create a TimescaleDB and Grafana instance
- Update
airquality_ingest.py
with your TimescaleDB connection string - Install necessary packages as listed in
requirements.txt
- Initialize your TimescaleDB database with the schemas specified in
schema.sql
- Run
python3 airquality_ingest.py
to start the ingestion - Create Grafana instance and import dashboard
Login to Grafana > Dashboard > Import > ./grafana.json