Get pollution indices for IDF (France)
Project description
firapria is a lightweight library to extract pollution indices from Airparif website for IDF (France).
Install
pip install firapria
Since version 0.1.1, firapria supports both Python 2.x and 3.x.
Usage
from firapria.pollution import get_indices
indices = get_indices()
It returns three integers, for yesterday’s, today’s and tomorrow’s indices. It might return only two integers sometimes, it’s when no prevision is available for tomorrow’s indice, usually before 11 AM.
The library also include a simple CLI of the same name:
$ firapria
Pollution:
Yesterday: 42
Today: 40
Tomorrow: 40
Before 0.1.1
get_indices was introduced in version 0.1.1. Before that one, another API was used. It’s still supported, but the new API is easier.
from firapria.pollution import PollutionFetcher indices = PollutionFetcher().indices()
Tests
Clone this repo, then:
[sudo] make deps make check