Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jezza34000/veolia-api

Veolia API client
https://github.com/jezza34000/veolia-api

api-client veolia

Last synced: 18 days ago
JSON representation

Veolia API client

Awesome Lists containing this project

README

        








Python wrapper for using Veolia API : https://www.eau.veolia.fr/

## Installation

```bash
pip install veolia-api
```

## Usage

```python
"""Example of usage of the Veolia API"""

import asyncio
import logging

from veolia_api.veolia_api import VeoliaAPI

logging.basicConfig(level=logging.DEBUG)

async def main() -> None:
"""Main function."""
# Create an instance of the VeoliaAPI class
api = VeoliaAPI("username", "password")

try:
# Fetch data for November 2024
await api.fetch_all_data(2024, 11)

# Display fetched data
print(api.account_data.daily_consumption)
print(api.account_data.monthly_consumption)
print(api.account_data.alert_settings.daily_enabled)

except Exception as e:
logging.error("An error occurred: %s", e)
finally:
await api.close()

if __name__ == "__main__":
asyncio.run(main())

```

## Credits

This repository is inspired by the work done by @CorentinGrard. Thanks to him for his work.