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

Uploaded Source

Built Distribution

veolia_api-1.0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: veolia_api-1.0.1.tar.gz
  • Upload date:
  • Size: 8.2 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.0.1.tar.gz
Algorithm Hash digest
SHA256 58c7e1158860b092fa9b34d54e2ab54900c1882f4cc054dc92244fe6ba464ee5
MD5 9a687d04c0de1d1daa76ff0ec749c1c4
BLAKE2b-256 2f94aadb6f476958d407fdd1edbbae5c05b6ca82f3ecb4df3b2a042f0d561a84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: veolia_api-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d776bddb907911fe18aff3efb631246644dcf3b72cd10efa27b5751a7ddc4a67
MD5 3d7c71bfcc061b6113b52cb1df91605d
BLAKE2b-256 f4be90de1ee5462a3a97defa43ee389e97f33dcc2786023735b5a6b8c67ff471

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