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.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: veolia_api-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9389492ce6d9cd389aca70519c7b4abc6a23ee16cb1ee07d5c49ceb082c69bc5
MD5 a5f95ca43e13de9776459c4de91a73f3
BLAKE2b-256 0360cb4ffd6a31414cebc524a33b4381e96a9c2ae2e389020731e17d0570e96f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: veolia_api-1.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83257d356bc493281ed3c665d52ea01612d3ab78500d79f4dd086a162cd38d6b
MD5 a5c4d84b28ac9753cf7b57592ae785c7
BLAKE2b-256 2142cb9d398871470ded08b03e1ccd0a04b67d4ae5fbf18528ccbb4dc6c35e54

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