Skip to main content

Async client for the Veolia water portals (eau.veolia.fr and delegated portals)

Project description

Async Python client for the Veolia water portal API (eau.veolia.fr).

Table of contents

Installation

First of all, you need to install devbox if you don't have a python environment

Once the previous step is done, simply run

devbox shell
cp .env.example .env   # fill in your credentials
python usage_example.py

That's it !

If you already have a python environment just run

pip install veolia-api-foxace

Usage

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

import asyncio
from datetime import date

import aiohttp

from veolia_api.veolia_api import VeoliaAPI


async def main() -> None:
    """Main function."""

    async with aiohttp.ClientSession() as session:
        client_api = VeoliaAPI("your@email.com", "password", session)

        await client_api.fetch_all_data(date(2025, 1, 1), date(2025, 9, 1))

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


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

You can use usage_example.py

Portals

Veolia operates several portals. They share the same Cognito authentication flow but each has its own client_id, and some run on a dedicated data backend. Select a portal with the portal_url argument (defaults to the national portal):

client_api = VeoliaAPI("your@email.com", "password", session, portal_url="www.ea-pm.fr")
portal_url Description Backend
eau.veolia.fr (default) Veolia France (national) default
eaudetm.monespace.eau.veolia.fr Eau de Toulouse Métropole default
www.ea-pm.fr Eau de Perpignan Méditerranée Métropole dedicated

To add a portal, add an entry to VEOLIA_PORTALS in veolia_api/portals.py with its client_id (found in the portal's JavaScript bundle as ClientId:"...") and, if different from the default, its backend_url.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md for guidelines on reporting bugs, suggesting features, and submitting pull requests.

Credits

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

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_foxace-2.3.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

veolia_api_foxace-2.3.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file veolia_api_foxace-2.3.0.tar.gz.

File metadata

  • Download URL: veolia_api_foxace-2.3.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for veolia_api_foxace-2.3.0.tar.gz
Algorithm Hash digest
SHA256 78480daa3d2229d86694234dcaf49fb6fc97ac9913fa8ec476284386bda60ee2
MD5 756035bcf0bac433c2902b37fb737bde
BLAKE2b-256 035882c128ae0a66198501b592dd731c7ab15c5567f192d97f9ddcce6deb8090

See more details on using hashes here.

Provenance

The following attestation bundles were made for veolia_api_foxace-2.3.0.tar.gz:

Publisher: publish.yml on foXaCe/veolia-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file veolia_api_foxace-2.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for veolia_api_foxace-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 020a86b6a8eaff55e1192e6fb302ff7740595940613183bf047c8bc9523f2cd7
MD5 22303c377570ef83aec30efa9249790f
BLAKE2b-256 fe45d6a9522c7f18c71e58d9693855b7673406613160873de9b997c5010b95a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for veolia_api_foxace-2.3.0-py3-none-any.whl:

Publisher: publish.yml on foXaCe/veolia-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page