Usage

To use the UNFCCC API, import the package and instantiate the reader, which will download the most recent metadata from the UNFCCC:

[1]:
import unfccc_di_api

reader = unfccc_di_api.UNFCCCApiReader()

Check for which parties data is available:

[2]:
reader.parties
[2]:
code name noData
id
3 AUS Australia NaN
4 AUT Austria NaN
5 BEL Belgium NaN
6 BGR Bulgaria NaN
7 BLR Belarus NaN
... ... ... ...
100214 VNM Viet Nam NaN
100215 YEM Yemen NaN
100216 ZMB Zambia NaN
100217 ZWE Zimbabwe NaN
100229 PSE State of Palestine NaN

198 rows × 3 columns

Access all data for a specific party:

[3]:
reader.query(party_code="AFG")
[3]:
party category classification measure gas unit year numberValue stringValue
0 AFG 1. Energy Total for category Net emissions/removals Aggregate GHGs Gg CO2 equivalent 2005 3776.15946 None
1 AFG 1. Energy Total for category Net emissions/removals Aggregate GHGs Gg CO2 equivalent 2013 10343.00000 None
2 AFG 1. Energy Total for category Net emissions/removals CH4 Gg 2005 35.06076 None
3 AFG 1. Energy Total for category Net emissions/removals CH4 Gg 2013 4.00000 None
4 AFG 1. Energy Total for category Net emissions/removals CO Gg 2005 865.20000 None
... ... ... ... ... ... ... ... ... ...
376 AFG unknown category nr. 10504 Total for category Total population No gas thousands 2015 27101.36500 None
377 AFG unknown category nr. 10504 Total for category Total population No gas thousands 2016 27657.14500 None
378 AFG unknown category nr. 10504 Total for category Total population No gas thousands 2017 28224.32300 None
379 AFG unknown category nr. 10504 Total for category Total population No gas thousands 2018 30075.01800 None
380 AFG unknown category nr. 10504 Total for category Total population No gas thousands 2019 30725.56000 None

381 rows × 9 columns

Queries can be more specific, e.g. selecting only data about one gas:

[4]:
reader.query(party_code="DEU", gases=["N₂O"])
[4]:
party category classification measure gas unit year numberValue stringValue
0 DEU 1. Energy Total for category Emission factor information N2O no unit 1990 NaN CS,D,M
1 DEU 1. Energy Total for category Emission factor information N2O no unit 1991 NaN CS,D,M
2 DEU 1. Energy Total for category Emission factor information N2O no unit 1992 NaN CS,D,M
3 DEU 1. Energy Total for category Emission factor information N2O no unit 1993 NaN CS,D,M
4 DEU 1. Energy Total for category Emission factor information N2O no unit 1994 NaN CS,D,M
... ... ... ... ... ... ... ... ... ...
35440 DEU Waste Incineration with Energy Recovery includ... Total for category Net emissions/removals N2O kt 2016 NaN NO
35441 DEU Waste Incineration with Energy Recovery includ... Total for category Net emissions/removals N2O kt 2017 NaN NO
35442 DEU Waste Incineration with Energy Recovery includ... Total for category Net emissions/removals N2O kt 2018 NaN NO
35443 DEU Waste Incineration with Energy Recovery includ... Total for category Net emissions/removals N2O kt 2019 NaN NO
35444 DEU Waste Incineration with Energy Recovery includ... Total for category Net emissions/removals N2O kt Base year NaN NO

35445 rows × 9 columns

Queries can be made much more specific, if you want to. Check the API docs section (next section), or the docstrings for details.