Skip to content

MrMarble/datadis

Repository files navigation

Datadis

Python client for https://datadis.es

GitHub Semantic Release PyPI - Downloads Quality Gate Status PyPI - Python Version

Installation

From PyPi

pip install datadis

Usage/Examples

import asyncio
from datadis import get_token, get_supplies

token = asyncio.run(get_token('username', 'password'))

supplies = asyncio.run(get_supplies(token))

#[
#    {
#        "address": "home",
#        "cups": "1234ABC",
#        "postalCode": "1024",
#        "province": "madrid",
#        "municipality": "madrid",
#        "distributor": "Energy",
#        "validDateFrom": "2020/09",
#        "validDateTo": "2021/09",
#        "pointType": 0,
#        "distributorCode": "2"
#    }
#]

Datadis time format

The datadis documentation is a bit sparse regarding the "time" attribute in some of the answers, read this comment from skgsergio on the topic #5 (comment)