Skip to content

garaud/kumo

Repository files navigation

Kumo

Kumo means cloud in Japanese.

Kumo is a REST API application for requesting air quality stations data in Europe. Data are provided in a GeoJSON format.

See an example at http://kumo.damiengaraud.org/api/doc/

Produced in Python with FlaskREST and PostgreSQL.

Clone this project with: git clone --recursive URL/kumo.git to also get the kumo-ui repo as a submodule.

Data

Data come from Airbase Database produced by the European Environment Agency

Take a look at the data folder:

  • get.py to download and extract the Airbase CSV file from the EEA website
  • raw_to_csv.py: read the raw Airbase CSV file then extract, transform and clean some data
  • airbase.csv: the cleaned data produced by the previous Python script

Create the kumo PostgreSQL database and execute the data/airbase.sql which just does a COPY...FROM the airbase.csv file.

Take a look to the data/README.rst to have more information about the data.

Install

There is a requirements.txt file.

  • Flask
  • flask-restful
  • flask-restplus
  • requests
  • pandas
  • psycopg2

API

Launch the kumo/app.py file to start the server.

Some examples:

http localhost:5000/api/stations/42
http localhost:5000/api/stations?country=France&type=traffic&limit=10
http localhost:5000/api/countries/
http localhost:5000/api/countries/Germany?limit=10

There is an API documentation generated by Swagger and the flask-restplus extension. Read this doc at localhost:5000/api/doc/.

About

Air Quality Stations Data REST API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published