https://github.com/mrmarble/datadis
Datadis python api client
https://github.com/mrmarble/datadis
api-client datadis electricity python spain
Last synced: 10 months ago
JSON representation
Datadis python api client
- Host: GitHub
- URL: https://github.com/mrmarble/datadis
- Owner: MrMarble
- License: mit
- Created: 2021-08-28T00:05:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T12:44:19.000Z (almost 2 years ago)
- Last Synced: 2024-10-07T20:47:53.541Z (over 1 year ago)
- Topics: api-client, datadis, electricity, python, spain
- Language: Python
- Homepage:
- Size: 97.7 KB
- Stars: 6
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Datadis
Python client for https://datadis.es

[](https://github.com/MrMarble/datadis/actions/workflows/release.yml)

[](https://sonarcloud.io/dashboard?id=MrMarble_datadis)

## Installation
From [PyPi](https://pypi.org/project/datadis/)
```bash
pip install datadis
```
## Usage/Examples
```python
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 https://github.com/MrMarble/datadis/issues/5#issuecomment-1550262886