Skip to main content

Client for the GRDF ADICT API

Project description

lowatt-grdf

A command-line tool and Python library to access GrDF Adict API, provided by Lowatt.

Licensing

It is published under the terms of the MIT license.

Installation

pip install lowatt-grdf

Command line usage

$ lowatt-grdf --help
Usage: lowatt-grdf [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  declare-acces
  donnees-consos-informatives
  donnees-consos-publiees
  donnees-contractuelles
  donnees-techniques
  droits-acces

Each subcommand implement the related API endpoint and output json that can easily be piped to jq for reading. Also each command will require to supply --client-id and --client-secret, or via corresponding environment variables CLIENT_ID and CLIENT_SECRET. These access are only provided by GRDF.

The droits-acces subcommand has also a --check parameter which will check consent validation:

  • statut_controle_preuve must not be Preuve en attente or Preuve Vérifiée KO
  • etat_droit_acces must be Active

This command is intended to be used at a daily basis in CI or cron, raising an alert in case of error, because it will require a manual correction.

Python library usage

Here is a sample code to access to the donnees-consos-publiees endpoint:

from lowatt_grdf.api import API

client_id = "ID"
client_secret = "SECRET"
pce = "23000000000000"

grdf = API(client_id, client_secret)
for releve in grdf.donnees_consos_publiees(pce, from_date="2021-01-01", to_date="2021-08-23"):
  conso = releve["consommation"]
  print(conso["date_debut_consommation"], conso["date_fin_consommation"], conso["energie"])

Contributions

Contribution are welcome through the Github repository.

Feel free to contact for more info by writing at info@lowatt.fr.

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

lowatt-grdf-2.1.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

lowatt_grdf-2.1.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file lowatt-grdf-2.1.1.tar.gz.

File metadata

  • Download URL: lowatt-grdf-2.1.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for lowatt-grdf-2.1.1.tar.gz
Algorithm Hash digest
SHA256 82b44de0c0e0cca71496946c5f9088b6f84bd13d65e88917251d1c29b914372b
MD5 a1bfc04e2b9370c7842b2691100ae71f
BLAKE2b-256 c7894c1243c238626037575cfb5fc271c76072dd026f5c171ae88526acaa75db

See more details on using hashes here.

File details

Details for the file lowatt_grdf-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: lowatt_grdf-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for lowatt_grdf-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e95391216e371c4538f0f33414bbe867248ab625fee7779eca0b24f922c0c13
MD5 c6929723d343862af5e0c63f47449af0
BLAKE2b-256 0561230250cc5d48cb504f9a48c84a280e989915a350cbb4a27ffb126fceed76

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