The OpenAQ API, located in the openaq_api, is built using Python 3 and FastAPI. It takes advantage of Pydantic for data validation.
It is recommended to install in a python virtual environment.
pip install -e .[dev]
A convenience executable is included to run a local development version of the API. You must have your environment set up (Setting up your Environment) prior to running.
The ETL process for the Version 2 Database is split into two parts. The ingest code is designed to load data that has been fetched and normalized by either OpenAQ Fetch or OpenAQ LCS Fetch into an s3 bucket.
After installing the Ingest Lambda, it is required to add a cloudwatch cron trigger (every 5 minutes recommended) and an s3 event trigger on the S3 Fetch Bucket. These can both be done from the AWS Lambda web console.