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 |
You can resolve a commune name to its portal at setup time:
from veolia_api import resolve_portal_url
portal = await resolve_portal_url("Toulouse") # "eaudetm.monespace.eau.veolia.fr"
client_api = VeoliaAPI("your@email.com", "password", session, portal_url=portal)
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.
Maintainers can regenerate the portal table from Veolia's national bundle:
python scripts/regenerate_portals.py
The script prints a candidate VEOLIA_PORTALS block and a diff against the
current table — review and edit veolia_api/portals.py manually.
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.
It is a fork of Jezza34000/veolia-api.
License
This project is licensed under the MIT License. See LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veolia_api_foxace-2.4.2.tar.gz.
File metadata
- Download URL: veolia_api_foxace-2.4.2.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1f1a82405c5bd0ceeeb2431367cb83e06976ab494b9506137c27517f3abe87
|
|
| MD5 |
5de701296074da93fa711e2a19f9bff6
|
|
| BLAKE2b-256 |
e16178f3700325bf13363defde5f247dd4de4298616fa70480e84c23538e2511
|
Provenance
The following attestation bundles were made for veolia_api_foxace-2.4.2.tar.gz:
Publisher:
publish.yml on foXaCe/veolia-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veolia_api_foxace-2.4.2.tar.gz -
Subject digest:
4a1f1a82405c5bd0ceeeb2431367cb83e06976ab494b9506137c27517f3abe87 - Sigstore transparency entry: 2138817226
- Sigstore integration time:
-
Permalink:
foXaCe/veolia-api@72e6c3682a0bd6aa7ca1e00a87ff4c36fc3ddbc2 -
Branch / Tag:
refs/tags/v2.4.2 - Owner: https://github.com/foXaCe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@72e6c3682a0bd6aa7ca1e00a87ff4c36fc3ddbc2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file veolia_api_foxace-2.4.2-py3-none-any.whl.
File metadata
- Download URL: veolia_api_foxace-2.4.2-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc410ccb82f1e3de06386db6d6513c26dce904ccb1757164ae8e6e51af0f4881
|
|
| MD5 |
ad06097181856504c0341e721020047f
|
|
| BLAKE2b-256 |
0a2409a69af2ae0c167c29e1782982234acac5ebd2c95713d2f1033afdfe3251
|
Provenance
The following attestation bundles were made for veolia_api_foxace-2.4.2-py3-none-any.whl:
Publisher:
publish.yml on foXaCe/veolia-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veolia_api_foxace-2.4.2-py3-none-any.whl -
Subject digest:
fc410ccb82f1e3de06386db6d6513c26dce904ccb1757164ae8e6e51af0f4881 - Sigstore transparency entry: 2138817266
- Sigstore integration time:
-
Permalink:
foXaCe/veolia-api@72e6c3682a0bd6aa7ca1e00a87ff4c36fc3ddbc2 -
Branch / Tag:
refs/tags/v2.4.2 - Owner: https://github.com/foXaCe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@72e6c3682a0bd6aa7ca1e00a87ff4c36fc3ddbc2 -
Trigger Event:
release
-
Statement type: