unfccc-di-api


Nameunfccc-di-api JSON
Version 4.0.0 PyPI version JSON
download
home_pagehttps://github.com/pik-primap/unfccc_di_api
SummaryPython wrapper around the Flexible Query API of the UNFCCC.
upload_time2023-07-18 13:31:34
maintainer
docs_urlNone
authorMika Pflüger
requires_python>=3.7
licenseApache Software License 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =============
UNFCCC DI API
=============


.. image:: https://img.shields.io/pypi/v/unfccc_di_api.svg
        :target: https://pypi.python.org/pypi/unfccc_di_api
        :alt: PyPI release

.. image:: https://readthedocs.org/projects/unfccc-di-api/badge/?version=main
        :target: https://unfccc-di-api.readthedocs.io/en/main/
        :alt: Documentation

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4457483.svg
   :target: https://doi.org/10.5281/zenodo.4457483


Python wrapper around the `Flexible Query API <https://di.unfccc.int/flex_annex1>`_ of
the UNFCCC.


* Free software: Apache Software License 2.0
* Documentation: https://unfccc-di-api.readthedocs.io.

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 <https://doi.org/10.5281/zenodo.4198782>`_, 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. (2023-07-18).
pik-primap/unfccc_di_api: Version 4.0.0.
Zenodo. https://doi.org/10.5281/zenodo.8160056

Data package
------------
If you just want all the data in CSV and parquet format (suitable for reading with
pandas), look at our `data package <https://doi.org/10.5281/zenodo.4198782>`_.

CI status and other links
-------------------------

.. image:: https://results.pre-commit.ci/badge/github/pik-primap/unfccc_di_api/main.svg
   :target: https://results.pre-commit.ci/latest/github/pik-primap/unfccc_di_api/main
   :alt: pre-commit.ci status

=========
Changelog
=========

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pik-primap/unfccc_di_api",
    "name": "unfccc-di-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mika Pfl\u00fcger",
    "author_email": "mika.pflueger@pik-potsdam.de",
    "download_url": "https://files.pythonhosted.org/packages/33/43/974b997868514947a8efb5eab8724eebdf8b8c4e14c163eab92997f3f84f/unfccc_di_api-4.0.0.tar.gz",
    "platform": null,
    "description": "=============\nUNFCCC DI API\n=============\n\n\n.. image:: https://img.shields.io/pypi/v/unfccc_di_api.svg\n        :target: https://pypi.python.org/pypi/unfccc_di_api\n        :alt: PyPI release\n\n.. image:: https://readthedocs.org/projects/unfccc-di-api/badge/?version=main\n        :target: https://unfccc-di-api.readthedocs.io/en/main/\n        :alt: Documentation\n\n.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4457483.svg\n   :target: https://doi.org/10.5281/zenodo.4457483\n\n\nPython wrapper around the `Flexible Query API <https://di.unfccc.int/flex_annex1>`_ of\nthe UNFCCC.\n\n\n* Free software: Apache Software License 2.0\n* Documentation: https://unfccc-di-api.readthedocs.io.\n\nWarning\n-------\n\nDue to a recent change in the UNFCCC's API, the UNFCCCApiReader class is\n**not functional** any more in standard environments. To continue to access the data,\nyou have two options:\n\n1. Use the new ZenodoReader. It provides access using the `query` function like the\n   UNFCCCApiReader, but only supports querying for a full dataset with all data. It\n   relies on our `data package <https://doi.org/10.5281/zenodo.4198782>`_, which we\n   update regularly; however, the data is naturally not as recent as querying from\n   the API directly.\n2. Run your functions in an environment which is not blocked by the UNFCCC DI API.\n   According to our tests, Azure virtual machines work, as well as github hosted\n   runners, with the exception of Mac OS runners.\n\n\nFeatures\n--------\n\n* High-level API to query all information for a given party.\n* Low-level API to selectively query information with the same resolution as in the\n  UNFCCC web query tool.\n\nCitation\n--------\nIf you use this library and want to cite it, please cite it as:\n\nMika Pfl\u00fcger, Daniel Huppmann & Johannes G\u00fctschow. (2023-07-18).\npik-primap/unfccc_di_api: Version 4.0.0.\nZenodo. https://doi.org/10.5281/zenodo.8160056\n\nData package\n------------\nIf you just want all the data in CSV and parquet format (suitable for reading with\npandas), look at our `data package <https://doi.org/10.5281/zenodo.4198782>`_.\n\nCI status and other links\n-------------------------\n\n.. image:: https://results.pre-commit.ci/badge/github/pik-primap/unfccc_di_api/main.svg\n   :target: https://results.pre-commit.ci/latest/github/pik-primap/unfccc_di_api/main\n   :alt: pre-commit.ci status\n\n=========\nChangelog\n=========\n\n4.0.0 (2023-07-18)\n------------------\n\n* Breaking: the UNFCCC restricted API access, likely you have to change your code to\n  use the new ZenodoReader instead.\n* Add ZenodoReader which doesn't rely on API access.\n* Use data released until 2023-07-18 when using the ZenodoReader.\n* Build the documentation on ReadTheDocs using newer Python and Sphinx versions.\n\n\n3.0.2 (2022-12-13)\n------------------\n\n* Support python 3.11.\n* Drop support for python 3.6.\n\n3.0.1 (2022-03-15)\n------------------\n\n* Fix handling of unspecified measure IDs. The DI API started returning measure IDs\n  without a name or description. We now call them ``unknown measure nr. {measureId}``\n  instead of erroring out.\n\n3.0.0 (2021-12-03)\n------------------\n\n* Support python 3.10.\n* Fix handling of duplicate variable IDs. **Note**: This entails changes to the public\n  API! In particular, UNFCCCSingleCategoryApiReader.variables now has a generic index\n  instead of using the ``variableId`` as index. Also, the ``query`` function now\n  correctly restricts queries if ``category_ids`` are provided and correctly fills\n  all categories with data for a multi-category variable.\n* Fix pre-commit config for newer mypy type checking versions.\n* Raise a more informative NoDataError (subclass of KeyError) instead of a generic\n  KeyError when a query result is empty.\n\n2.0.1 (2021-04-23)\n------------------\n\n* Change build system.\n\n2.0.0 (2021-02-09)\n------------------\n\n* Accept ASCII format for ``gases`` when querying data\n  and return gases & units normalized to ASCII (optional), thanks to Daniel Huppmann.\n  Note that gases and units are normalized to ASCII by default, if you need the old\n  behaviour for compatibility reasons, pass ``normalize_gas_names=False`` to your\n  ``query()`` calls.\n\n1.1.1 (2021-02-08)\n------------------\n\n* Include ipython notebooks and CHANGELOG in release tarballs.\n\n1.1.0 (2021-01-25)\n------------------\n\n* Add a useful error message when querying for unknown parties, thanks to\n  Daniel Huppmann.\n\n1.0.0 (2021-01-22)\n------------------\n\n* Add continuous integration using GitHub actions.\n* Add tests.\n* Add usage documentation in notebook format.\n* Documentation fixes.\n\n0.1.0 (2021-01-22)\n------------------\n\n* First release on PyPI.\n* Convert API wrapper into standalone Python package.\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Python wrapper around the Flexible Query API of the UNFCCC.",
    "version": "4.0.0",
    "project_urls": {
        "Documentation": "https://unfccc-di-api.readthedocs.io",
        "Homepage": "https://github.com/pik-primap/unfccc_di_api"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9fa96ffa0d328735d0f852736ecf686cbea2b4680820d7861c8d5c708912e001",
                "md5": "078ec237b7f474acd11c09b74e29c865",
                "sha256": "986ea2e07981dbd3af5ac5ceda36d5142d69eac929531c97b55ad1015fa5d182"
            },
            "downloads": -1,
            "filename": "unfccc_di_api-4.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "078ec237b7f474acd11c09b74e29c865",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12598,
            "upload_time": "2023-07-18T13:31:32",
            "upload_time_iso_8601": "2023-07-18T13:31:32.651122Z",
            "url": "https://files.pythonhosted.org/packages/9f/a9/6ffa0d328735d0f852736ecf686cbea2b4680820d7861c8d5c708912e001/unfccc_di_api-4.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3343974b997868514947a8efb5eab8724eebdf8b8c4e14c163eab92997f3f84f",
                "md5": "6b529504a70f55d7cd04f10a6d0db57c",
                "sha256": "5ac6c4c81175c7a2c242724bf173040ce870dcf593b156f07aa02a8c05d96d79"
            },
            "downloads": -1,
            "filename": "unfccc_di_api-4.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6b529504a70f55d7cd04f10a6d0db57c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 24211,
            "upload_time": "2023-07-18T13:31:34",
            "upload_time_iso_8601": "2023-07-18T13:31:34.018867Z",
            "url": "https://files.pythonhosted.org/packages/33/43/974b997868514947a8efb5eab8724eebdf8b8c4e14c163eab92997f3f84f/unfccc_di_api-4.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-18 13:31:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pik-primap",
    "github_project": "unfccc_di_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "unfccc-di-api"
}
        
Elapsed time: 0.10965s