Skip to main content

UNFCCC DI API

PyPI release Documentation https://zenodo.org/badge/DOI/10.5281/zenodo.4457483.svg

Python wrapper around the Flexible Query API of the UNFCCC.

Warning

Due to a recent change in the UNFCCC’s API, the UNFCCCApiReader class is not functional any more in standard environments. To continue to access the data, you have two options:

  1. Use the new ZenodoReader. It provides access using the query function like the UNFCCCApiReader, but only supports querying for a full dataset with all data. It relies on our data package, which we update regularly; however, the data is naturally not as recent as querying from the API directly.

  2. Run your functions in an environment which is not blocked by the UNFCCC DI API. According to our tests, Azure virtual machines work, as well as github hosted runners, with the exception of Mac OS runners.

Features

  • High-level API to query all information for a given party.

  • Low-level API to selectively query information with the same resolution as in the UNFCCC web query tool.

Citation

If you use this library and want to cite it, please cite it as:

Mika Pflüger, Daniel Huppmann & Johannes Gütschow. (2024-01-08). pik-primap/unfccc_di_api: Version 4.0.4. Zenodo. https://doi.org/10.5281/zenodo.10471122

Data package

If you just want all the data in CSV and parquet format (suitable for reading with pandas), look at our data package.

Changelog

4.0.4 (2024-07-05)

  • Use the latest data release which switched to a single parquet file for all data.

4.0.3 (2024-07-04)

  • Re-release 4.0.2 due to technical reasons.

4.0.2 (2024-07-04)

  • Use data released until 2024-07-04 when using the ZenodoReader.

4.0.1 (2024-01-08)

  • Use data released until 2024-01-08 when using the ZenodoReader.

  • Support python 3.12.

4.0.0 (2023-07-18)

  • Breaking: the UNFCCC restricted API access, likely you have to change your code to use the new ZenodoReader instead.

  • Add ZenodoReader which doesn’t rely on API access.

  • Use data released until 2023-07-18 when using the ZenodoReader.

  • Build the documentation on ReadTheDocs using newer Python and Sphinx versions.

3.0.2 (2022-12-13)

  • Support python 3.11.

  • Drop support for python 3.6.

3.0.1 (2022-03-15)

  • Fix handling of unspecified measure IDs. The DI API started returning measure IDs without a name or description. We now call them unknown measure nr. {measureId} instead of erroring out.

3.0.0 (2021-12-03)

  • Support python 3.10.

  • Fix handling of duplicate variable IDs. Note: This entails changes to the public API! In particular, UNFCCCSingleCategoryApiReader.variables now has a generic index instead of using the variableId as index. Also, the query function now correctly restricts queries if category_ids are provided and correctly fills all categories with data for a multi-category variable.

  • Fix pre-commit config for newer mypy type checking versions.

  • Raise a more informative NoDataError (subclass of KeyError) instead of a generic KeyError when a query result is empty.

2.0.1 (2021-04-23)

  • Change build system.

2.0.0 (2021-02-09)

  • Accept ASCII format for gases when querying data and return gases & units normalized to ASCII (optional), thanks to Daniel Huppmann. Note that gases and units are normalized to ASCII by default, if you need the old behaviour for compatibility reasons, pass normalize_gas_names=False to your query() calls.

1.1.1 (2021-02-08)

  • Include ipython notebooks and CHANGELOG in release tarballs.

1.1.0 (2021-01-25)

  • Add a useful error message when querying for unknown parties, thanks to Daniel Huppmann.

1.0.0 (2021-01-22)

  • Add continuous integration using GitHub actions.

  • Add tests.

  • Add usage documentation in notebook format.

  • Documentation fixes.

0.1.0 (2021-01-22)

  • First release on PyPI.

  • Convert API wrapper into standalone Python package.

Metadata

Release files for unfccc-di-api 4.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unfccc-di-api 4.0.4
File Size Uploaded Provenance Actions
unfccc_di_api-4.0.4.tar.gz 25.0 kB Without provenance Details for unfccc_di_api-4.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unfccc-di-api 4.0.4
File Interpreter ABI Platform Actions
unfccc_di_api-4.0.4-py3-none-any.whl Python 3 none any Details for unfccc_di_api-4.0.4-py3-none-any.whl

Total release size: 37.9 kB

Release files / unfccc_di_api-4.0.4.tar.gz

Download URL unfccc_di_api-4.0.4.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
86b53cfe274d9ea53e265d3f998dece53a0bd683618100be83e5e0603e9e32dc
BLAKE2b-256 checksum
How to use checksums
933d4529ef604fe27dd67ce61e8cea573c39fa17243233e03bb96e3097d42bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / unfccc_di_api-4.0.4-py3-none-any.whl

Download URL unfccc_di_api-4.0.4-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8f879bb7a629d9088526ecc23f456ab3c4c7184a0cc68540647993411e80e15
BLAKE2b-256 checksum
How to use checksums
48167f5ee2381912fe355ae03459b3e77f084e20a32c06cce7d4a888a3fc28db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for unfccc-di-api 4.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page