Skip to content

Latest commit

 

History

History
 
 

air-quality

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Air Quality Collection - Sample Application

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.

Requirements

  • A working instance of TimescaleDB
  • Python3 environment
  • Install python dependencies with pip3 install -r requirements.txt

Content

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.

Getting Started

  1. Create a TimescaleDB and Grafana instance
  2. Update airquality_ingest.py with your TimescaleDB connection string
  3. Install necessary packages as listed in requirements.txt
  4. Initialize your TimescaleDB database with the schemas specified in schema.sql
  5. Run python3 airquality_ingest.py to start the ingestion
  6. Create Grafana instance and import dashboard Login to Grafana > Dashboard > Import > ./grafana.json