Skip to main content

Python wrapper for Veolia API

Project description

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

Installation

pip install veolia-api

Usage

"""Example of usage of the Veolia API"""

import asyncio
import logging

from veolia_api.veolia_api import ConsumptionType, VeoliaAPI

logging.basicConfig(level=logging.DEBUG)


async def main() -> None:

    api = VeoliaAPI("username", "password")
    await api.login()

    try:
        ### Get the consumption data for the year 2024
        data = await api.get_consumption_data(ConsumptionType.YEARLY, 2024)
        print(data)

        ### Get the consumption data for Octobre 2024
        data = await api.get_consumption_data(ConsumptionType.MONTHLY, 2024, 10)
        print(data)

        #### Get the alerts set for the account
        data = await api.get_alerts()
        print(data)

        ### Set the alerts for the account
        alerts = AlertSettings(
            daily_enabled=True,
            daily_threshold=550,
            daily_contact_email=True,
            daily_contact_sms=True,
            monthly_enabled=True,
            monthly_threshold=8,
            monthly_contact_email=True,
            monthly_contact_sms=True
        )
        data = await api.set_alerts(alerts)
        print(data)
        
    finally:
        await api.close()


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

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

veolia_api-1.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

veolia_api-1.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file veolia_api-1.1.0.tar.gz.

File metadata

  • Download URL: veolia_api-1.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for veolia_api-1.1.0.tar.gz
Algorithm Hash digest
SHA256 15355327e3ec587334efa1645ea7ece006a3ef6aeb0a59057460db4c6de143aa
MD5 7d18de61db245f037f15b9412066bdd7
BLAKE2b-256 32817e701e28c2a9bbe1dd04c3e3339e6373e8f69b12d728bc5d3c74c70d5b46

See more details on using hashes here.

File details

Details for the file veolia_api-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: veolia_api-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for veolia_api-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa838ae506f2dde9f10b68bb75520524a5ee09b50db51a9ec3825dae2326a10e
MD5 c8ced1fdbc972807c918326064938d12
BLAKE2b-256 9ba594aa445d9a92f50a255bf76923f0e6b2cb92b24adfb28e79210415420232

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