Skip to content

eea/raven-public-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAVEN Public API

Raven is an open source web based Air Quality data validation and e-reporting system, with the aim to control the flow, metadata inventory, the quality of the monitoring data and producing the XML files required for the Air Quality B-G, except from D1b (Information on the assessment methods - for models and objective estimation) and E1b (Information on primary validated assessment data – modelled).
The system is managed and developed by NILU, with support from 4sFera, on the behalf of the European Environmental Agency.
Raven Public API is a supplement to Raven to share data with the public

Requirements

Python version 3.10.8
Raven Administration Database v3.1.0+: (https://github.com/eea/raven-administration)

Clone repository from git

git clone https://github.com/eea/raven-public-api

Set environment varables

Create a file called .env in the root folder and set the variable

DATABASE_URI = postgresql://dbuser:password@host:port/database
INCLUDE_EEA = False
USE_PREAGG = False
USE_LOCAL_AQI_IF_AVAILABLE = False

Docker

Make sure you have Docker engine installed. (https://www.docker.com/)
Then build and run the docker-compose file.

# build and run
docker-compose build
docker-compose up

The application will run at http://localhost:5000

The default port is 5000.
Add the environment variable API_PORT to change this.

Development

Create a virtual environment and activate it

# create
python -m venv venv
# activate on Windows
.\venv\Scripts\activate
# activate on Mac and Linux
source venv/bin/activate

In the api folder install the required python packages

pip install -r requirements.txt

Run Raven

# from inside the api folder start backend server
uvicorn app:app --reload

LOCAL AQI

To use LOCAL AQI set USE_LOCAL_AQI_IF_AVAILABLE = True.
Local aqi can be defined in Raven Administrator

EEA/E2a

To enable E2a endpoint, add INCLUDE_EEA = True in the .env file.
EEA can then use the endpoint GET eea/e2a/?last_request=<datetime> to retrieve utd data
last_request in this context means you will get all data that has changes since this date
There is a maximum limit of 3 months.

Pre aggregations

To enable the use of pre aggregation, add USE_PREAGG = True in the .env file.
Make sure the sql script https://git.nilu.no/raven/raven-administration/-/blob/master/sql/pre_aggregates.sql is installed,
and that a scheduled task is set up to update the aggregations.
See https://git.nilu.no/raven/raven-administration#pre-aggregations for more information

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages