Package: aqeea
aqeeaAccess to air quality data from the European Environment Agency:Data validated by experts from 2013 up to 2 years before the ongoing year.up-to-date data without any validation.the last 48h.You can get the main pollutants (i.e NO, NO2, PM2.5, PM10, SO2, O3, CO,C6H6).The packages aims at:i) retrieving the datasets from EEA download sources.ii) filtering the data of your choice once downloaded.install from Pypipipinstallaqeeainstall from sourcemkdirtmpcd/tmp
gitclonehttps://github.com/j-m-l-e-u/aqeea_pkg.gitcdaqeea_pkg
pip3install.UsageThe packageaqeeahelps you first to download the datasets, and then to read and to filter them.Downloading functions can be run both on python and bash.Reading functions are only available in python.For help:python3aqeea-h

usage:aqeea[-h]{l_pol,l_city,d_meta,d_hist,d_last}...

AccesstoairqualitydatafromtheEuropeanEnvironmentAgency.

positionalarguments:{l_pol,l_city,d_meta,d_hist,d_last}sub-commandhelpl_polGetthelistofpollutantsmeasuredinthecountryl_cityGetthelistofthecitieswithmeasurementsinthecountryd_metaDownloadthemetadataofthereferencestationsd_histDownloadhistoricaldataupto2013d_lastDownloadthelast48hnon-validateddata

optionalarguments:-h,--helpshowthishelpmessageandexitDownload the data of your choice:Downloading can be done either in bash command or in python command.All the files are saved in a folder (called blob).
Bash command requires the path of the blob to be given.
Python command gets a default path if this one is missing.You need to download the metadata and the files from the sources of interest before reading the files.> The metadata#bashpython3aqeead_metadata-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_metadatad_metadata()> Validated PM10 data for year 2021 in France#bashpython3aqeead_historical-svalidated-cFrance-pPM10-yf2021-yt2021-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_historicald_historical(source='validated',country='France',pollutant='PM10',year_from=2021,year_to=2021)> Validated data ofallthe pollutants for thewholeperiod in Albania#bashpython3aqeead_historical-svalidated-cAlbania--pollutants--years-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_historicald_historical(source='validated',country='Albania',POLLUTANTS=True,YEARS=True)> Up-to-date PM10 data for year 2023 in Estonia#bashpython3aqeead_historical-suptodate-cEstonia-pPM10-yf2023-yt2023-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_historicald_historical(source='uptodate',country='Estonia',pollutant='PM10',year_from=2023,year_to=2023)> Up-to-date data ofallthe pollutants for thewholeperiod in Slovenia#bashpython3aqeead_historical-suptodate-cSlovenia--pollutants--years-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_historicald_historical(source='uptodate',country='Slovenia',POLLUTANTS=True,YEARS=True)> Latest 48h of PM10 in Serbia#bashpython3aqeead_latest-cSerbia-pPM10-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_latestd_latest('Serbia','PM10')> Latest 48h of PM10 inallcountries registered at EEA#bashpython3aqeead_latest-pPM10--countries-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_latestd_latest('PM10',COUNTRIES=True)> Latest 48h dataset ofallthe pollutants in Poland#bashpython3aqeead_latest-cPoland--pollutants-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_latestd_latest('Poland',POLLUTANTS=True)> Latest 48h dataset ofallthe pollutants inallcountries registered at EEA#bashpython3aqeead_latest--countries--pollutants-b"/path/to/existing/folder"#pythonfromaqeea.downloadimportd_latestd_latest(COUNTRIES=True,POLLUTANTS=True)Read and filter the downloaded datasets:The chosen sampling points providing the measurements are filtered by their measurement date and the lat/lon's of the boundary box of your choice.
Open-street Map through the packageosmnxhelps you getting this information.To installosmnx, just type:#bashpipinstallosmnx> Get the validated PM10 data in Paris, France from 2021-01-01 00:00:00 UTC to 2021-01-01 12:00:00 UTC#pythonimportosmnxasoxfromaqeea.readimporthistorical# define the place queryquery={'city':'Paris'}# get the boundaries of the placegdf=ox.geocode_to_gdf(query)bbox=gdf.total_boundslat_min,lat_max=bbox[1],bbox[3]lon_min,lon_max=bbox[0],bbox[2]res=historical(source='validated',pollutant='PM10',datetime_from='2021-01-01 00:00:00',datetime_to='2021-01-01 12:00:00',lat_min=lat_min,lat_max=lat_max,lon_min=lon_min,lon_max=lon_max)> Get the up-to-date PM10 data in Tallinn, Estonia from 2023-01-01 00:00:00 UTC to 2023-01-12 00:00:00 UTC#pythonimportosmnxasoxfromaqeea.readimporthistorical# define the place queryquery={'city':'Tallinn'}# get the boundaries of the placegdf=ox.geocode_to_gdf(query)bbox=gdf.total_boundslat_min,lat_max=bbox[1],bbox[3]lon_min,lon_max=bbox[0],bbox[2]res=historical(source='uptodate',pollutant='PM10',datetime_from='2023-01-01 00:00:00',datetime_to='2023-01-12 00:00:00',lat_min=lat_min,lat_max=lat_max,lon_min=lon_min,lon_max=lon_max)> Get the last 48h PM10 data in Paris,France#pythonfromaqeea.readimportmain_read_latestres=latest(pollutant='PM10',lat_min=48.8155755,lat_max=48.902156,lon_min=2.224122,lon_max=2.4697602)> Get the metadata of PM10 concentration in Paris,France#pythonfromaqeea.readimportmain_read_metadatares=metadata(pollutant='PM10',lat_min=48.8155755,lat_max=48.902156,lon_min=2.224122,lon_max=2.4697602)Notebook examplesSee folderexamples