Skip to main content

Client for the GRDF ADICT API

Project description

lowatt-grdf

A command-line tool and Python library to access GrDF Addict 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-1.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

lowatt_grdf-1.3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lowatt-grdf-1.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for lowatt-grdf-1.3.tar.gz
Algorithm Hash digest
SHA256 a8f8c16a7ed6127709c3d2a491bb9f18ce5ae7bc6ef4b1a97774254f4e42520f
MD5 ea5ba3ed55d14872a4a122d745a0fc58
BLAKE2b-256 908a94454d8021584efaff96162e9e7fcc3ae3eb79bf54b061d57e1dcdc89137

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lowatt_grdf-1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for lowatt_grdf-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e0b93be03b73b3f18646fc3e9372c1fade70c2879078d89186aa971cdb28aa9
MD5 15ef85315b60cdb8e273f5aae825e2e3
BLAKE2b-256 09c2c24a823a076c8021916bc1234c31ed881bb81ca89c7b406ce47420a46274

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