Skip to main content

Python wrapper for the RTE Data APIs

Project description

Supported Python versions Code style: Black Mypy: checked Imports: isort

data-rte-python-api is a Python API wrapper for the APIs of the RTE.

Installation

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

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data-rte-python-api-0.0.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

data_rte_python_api-0.0.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file data-rte-python-api-0.0.1.tar.gz.

File metadata

  • Download URL: data-rte-python-api-0.0.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for data-rte-python-api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2dc61e0b2028b58273ffb5c5d6709081031ccb967ff39b7cb26c52ab7bfccccc
MD5 ddf8214955d20f81a11d6637842309af
BLAKE2b-256 84343148df0025e896c2830365fac63c9f1f6c7222bb5450ccf6aaeb92b2dc67

See more details on using hashes here.

File details

Details for the file data_rte_python_api-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for data_rte_python_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 936513c72deb8a6f09b64cafbffe9683713ad5335a1123df1f8807b9f3b21b07
MD5 27eb87ca982257e3afce15b188735b3a
BLAKE2b-256 94e1395a53c4694c169d3db49860f1c6ea783f4cd7fa7e295d3883036353f145

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page