data-rte-python-api


Namedata-rte-python-api JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/Viicos/data-rte-python-api
SummaryPython wrapper for the RTE Data APIs
upload_time2022-12-11 17:07:58
maintainerViicos
docs_urlNone
authorViicos
requires_python>=3.7
licenseMIT
keywords api rte datarte
VCS
bugtrack_url
requirements requests typing_extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
data-rte-python-api: A Python API wrapper for the data APIs of the RTE
======================================================================

|python-versions| |code-style| |mypy| |isort|


``data-rte-python-api`` is a Python API wrapper for the `APIs of the RTE <https://data.rte-france.com/>`_.

Installation
------------

The library can be installed using ``pip`` (the library is not published on PyPI yet):

.. code-block:: shell

    pip install data-rte-python-api

Usage
-----

You will have to register an application to get a ``client_id`` and ``client_secret`` before using any of the APIs.

.. code-block:: python

    from datetime import datetime

    from datarteapi import BigSubstations, BaseAPIException

    client = BigSubstations(client_id="your_client_id", client_secret="your_client_secret")

    try:
        apiresponse = client.get_pds_data(
            start_date=datetime.fromisoformat("2017-09-01T12:00:00"),
            end_date=datetime.fromisoformat("2017-09-01T23:00:00")
        )
    except BaseAPIException as e:
        # Handle the exception

    print(apiresponse.data, apiresponse.headers)

Currently, only the APIs working with OAuth are available.

Date entries
------------

Depending on the API you are using, date timezones are handled differently. If all timezones are supported by the API server, the datetime will be used as is.
If only UTC is supported, timezone aware dates will be converted to UTC. For unware dates, local timezone is used before being converted to UTC.

For more details, refer to the corresponding API documentation.

.. |python-versions| image:: https://img.shields.io/badge/python-3.7%2B-blue.svg
    :alt: Supported Python versions
    :target: https://www.python.org/downloads/

.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :alt: Code style: Black
    :target: https://github.com/psf/black

.. |mypy| image:: https://img.shields.io/badge/mypy-checked-blue
    :alt: Mypy: checked
    :target: http://mypy-lang.org/

.. |isort| image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
    :alt: Imports: isort
    :target: https://pycqa.github.io/isort/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Viicos/data-rte-python-api",
    "name": "data-rte-python-api",
    "maintainer": "Viicos",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "65306057+Viicos@users.noreply.github.com",
    "keywords": "api,rte,datarte",
    "author": "Viicos",
    "author_email": "65306057+Viicos@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/84/34/3148df0025e896c2830365fac63c9f1f6c7222bb5450ccf6aaeb92b2dc67/data-rte-python-api-0.0.1.tar.gz",
    "platform": null,
    "description": "\ndata-rte-python-api: A Python API wrapper for the data APIs of the RTE\n======================================================================\n\n|python-versions| |code-style| |mypy| |isort|\n\n\n``data-rte-python-api`` is a Python API wrapper for the `APIs of the RTE <https://data.rte-france.com/>`_.\n\nInstallation\n------------\n\nThe library can be installed using ``pip`` (the library is not published on PyPI yet):\n\n.. code-block:: shell\n\n    pip install data-rte-python-api\n\nUsage\n-----\n\nYou will have to register an application to get a ``client_id`` and ``client_secret`` before using any of the APIs.\n\n.. code-block:: python\n\n    from datetime import datetime\n\n    from datarteapi import BigSubstations, BaseAPIException\n\n    client = BigSubstations(client_id=\"your_client_id\", client_secret=\"your_client_secret\")\n\n    try:\n        apiresponse = client.get_pds_data(\n            start_date=datetime.fromisoformat(\"2017-09-01T12:00:00\"),\n            end_date=datetime.fromisoformat(\"2017-09-01T23:00:00\")\n        )\n    except BaseAPIException as e:\n        # Handle the exception\n\n    print(apiresponse.data, apiresponse.headers)\n\nCurrently, only the APIs working with OAuth are available.\n\nDate entries\n------------\n\nDepending on the API you are using, date timezones are handled differently. If all timezones are supported by the API server, the datetime will be used as is.\nIf only UTC is supported, timezone aware dates will be converted to UTC. For unware dates, local timezone is used before being converted to UTC.\n\nFor more details, refer to the corresponding API documentation.\n\n.. |python-versions| image:: https://img.shields.io/badge/python-3.7%2B-blue.svg\n    :alt: Supported Python versions\n    :target: https://www.python.org/downloads/\n\n.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :alt: Code style: Black\n    :target: https://github.com/psf/black\n\n.. |mypy| image:: https://img.shields.io/badge/mypy-checked-blue\n    :alt: Mypy: checked\n    :target: http://mypy-lang.org/\n\n.. |isort| image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336\n    :alt: Imports: isort\n    :target: https://pycqa.github.io/isort/\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python wrapper for the RTE Data APIs",
    "version": "0.0.1",
    "split_keywords": [
        "api",
        "rte",
        "datarte"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "27eb87ca982257e3afce15b188735b3a",
                "sha256": "936513c72deb8a6f09b64cafbffe9683713ad5335a1123df1f8807b9f3b21b07"
            },
            "downloads": -1,
            "filename": "data_rte_python_api-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27eb87ca982257e3afce15b188735b3a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15961,
            "upload_time": "2022-12-11T17:07:55",
            "upload_time_iso_8601": "2022-12-11T17:07:55.976712Z",
            "url": "https://files.pythonhosted.org/packages/94/e1/395a53c4694c169d3db49860f1c6ea783f4cd7fa7e295d3883036353f145/data_rte_python_api-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "ddf8214955d20f81a11d6637842309af",
                "sha256": "2dc61e0b2028b58273ffb5c5d6709081031ccb967ff39b7cb26c52ab7bfccccc"
            },
            "downloads": -1,
            "filename": "data-rte-python-api-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ddf8214955d20f81a11d6637842309af",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10605,
            "upload_time": "2022-12-11T17:07:58",
            "upload_time_iso_8601": "2022-12-11T17:07:58.343992Z",
            "url": "https://files.pythonhosted.org/packages/84/34/3148df0025e896c2830365fac63c9f1f6c7222bb5450ccf6aaeb92b2dc67/data-rte-python-api-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-11 17:07:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Viicos",
    "github_project": "data-rte-python-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.14.0"
                ]
            ]
        },
        {
            "name": "typing_extensions",
            "specs": [
                [
                    ">=",
                    "3.10.0.0"
                ]
            ]
        }
    ],
    "lcname": "data-rte-python-api"
}
        
Elapsed time: 0.07902s