Skip to main content

Retrieve water consumption from Veolia Ile-de-France web site (French Water Company)

Project description

PyVeoliaIDF

PyVeoliaIDF is a Python library for getting water consumption from Veolia French provider.

Their water meter are wireless and transmit the consumption once per day.

All consumption data is available on the client account at Veolia Web Site (https://espace-client.vedif.eau.veolia.fr).

PyVeoliaIDF automatically go through the Web Site and download the consumption data CSV file, and make it available in a Python structure (list of dictionaries).

Installation

Requirements

PyVeoliaIDF is working with Selenium Python library to automate navigation through Veolia Web site. Selenium requires a WebDriver that acts as gateway between automatic actions from PyVeoliaIDF and a native browser already installed on the system.

PyVeoliaIDF has been developped and tested with Firefox browser (version 68.8) and its corresponding Web Driver geckodriver (version 0.24).

Firefox browser installation

Follow instructions here

Firefox Web Driver (geckodriver) installation

Follow instructions here

Create your virtual environment

$ pip install virtualenv

$ cd /path/to/my_project_folder/

$ virtualenv venv

PyVeoliaIDF installation

Use the package manager pip to install PyVeoliaIDF.

pip install pyveoliaidf

You can also download the source code and install it manually.

cd /path/to/pyveoliaidf/
python setup.py install

Usage

Command line

$ pyveoliaidf -u 'your login' -p 'your password' -w 'path/to/Selenium Web Driver' -s 30 -t 'temporary directory where to store CSV file (ex: /tmp)'

Library

import pyveoliaidf

client = pyveoliaidf.Client('your login',
                         'your password',
                         365,
                         'path/to/Selenium Web Driver',
                         30,
                         'temporary directory where to store CSV file (ex: /tmp)')

client.update()

data = client.data()

Output

data =>
[
  {
    "time": "2019-07-14 19:00:00",
    "total_liter": "506669",
    "daily_liter": "530",
    "type": "Estim\u00c3\u00a9",
    "timestamp": "2019-08-31T16:55:01.236779"
  },
  {
    "time": "2019-07-15 19:00:00",
    "total_liter": "507523",
    "daily_liter": "854",
    "type": "Mesur\u00c3\u00a9",
    "timestamp": "2019-08-31T16:55:01.236779"
  },
  {
    "time": "2019-07-16 19:00:00",
    "total_liter": "508314",
    "daily_liter": "791",
    "type": "Mesur\u00c3\u00a9",
    "timestamp": "2019-08-31T16:55:01.236779"
  }
]

Limitation

PyVeoliaIDF relies on how Veolia Web Site is built. It goes through each Web pages and automatically fill forms, click buttons using their internal identifiers.

Any change in the Web site structure or identifier naming may break this library.

We expect in close Future that Veolia makes available a standard API from which we can get safely their data.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project status

PyVeoliaIDF has been initiated for integration with Home Assistant.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.4.5] - 2025-10-06

Fixed

#7: The site "L'eau d'Ile de France" has some button identifier changed.

[0.4.4] - 2025-06-15

Fixed

#6: The site "L'eau d'Ile de France" login page has been changed.

[0.4.3] - 2025-05-25

Fixed

#5: The site "L'eau d'Ile de France" structure has been changed.

[0.4.2] - 2025-04-10

Fixed

#4: Login failure.

[0.4.1] - 2025-01-13

Fixed

#3: The new site "L'eau d'Ile de France" structure has been changed.

[0.4.0] - 2025-01-02

Fixed

#2: Migration from "Veolia Ile de France" to "L'eau d'Ile de France".

[0.3.4] - 2024-01-27

Fixed

  • Set the correct firefox location for Linux.

[0.3.3] - 2024-01-27

Fixed

  • Fix wrong Selenium version in setup.cfg.

[0.3.2] - 2024-01-27

Fixed

  • Add Python 3.11 and 3.12 support.

[0.3.1] - 2024-01-27

Fixed

  • Fix lint error: W291 trailing whitespace

[0.3.0] - 2024-01-27

Fixed

  • The Web site has changed some component xpath.

Changed

  • Upgrade Selenium version to 4.17.2
  • Upgrade Geckodriver version to 0.34.0

[0.2.1] - 2023-02-05

Fixed

  • The Web site has changed some component xpath.

[0.2.0] - 2022-10-17

Added

  • Add a new parameter 'lastNDays' that permits to control how many days of data we want to retrieve.

Fixed

  • Add some means that permits to log every Selenium actions.
  • Add some controls on the downloaded data file (check its content) before processing it.

[0.1.13] - 2021-12-03

Fixed

  • Increase waiting time after selection of 'Jours' and 'Litres' buttons. Sometimes, we get only a partial set of data with missing most recent ones.

0.1.12 - 2020-10-12

Fixed

  • The Veolia login email text box has changed its identifier.

0.1.11 - 2020-10-03

Fixed

  • After simulating clicks on the 'Jours' and 'Litres' buttons, we have to wait a few (5 seconds) for internal form refresh. Otherwise, we got an inconsistent data file.

0.1.10 - 2020-10-03

Fixed

  • The VeoliaIDF web site has changed and added some buttons to select the consumption period and the consumption unit.

0.1.9 - 2019-08-31

Fixed

  • WebDriver window size must be large enough to display all clickable components.

0.1.8 - 2019-08-31

Added

  • Use PropertyNameEnum type to store all property names.
  • Add LoginError exception raised when PyVeoliaIDF is unable to sign in the Veolia Web site with the given username/password.
  • Add timestamp property that contains date/time when the data has been retrieved.

MIT License

Copyright (c) 2019 Stéphane Senart

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

pyveoliaidf-0.4.5.tar.gz (13.7 kB view details)

Uploaded Source

Built Distributions

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

pyveoliaidf-0.4.5-py312-none-any.whl (12.8 kB view details)

Uploaded Python 3.12

pyveoliaidf-0.4.5-py311-none-any.whl (12.7 kB view details)

Uploaded Python 3.11

pyveoliaidf-0.4.5-py310-none-any.whl (12.7 kB view details)

Uploaded Python 3.10

pyveoliaidf-0.4.5-py39-none-any.whl (12.7 kB view details)

Uploaded Python 3.9

File details

Details for the file pyveoliaidf-0.4.5.tar.gz.

File metadata

  • Download URL: pyveoliaidf-0.4.5.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pyveoliaidf-0.4.5.tar.gz
Algorithm Hash digest
SHA256 6038590941fc49e8955ed7f848377999ead9626e8a4906686181b10b09e7f6c4
MD5 cc034e23633b40387ed25e9026d53281
BLAKE2b-256 2637f778f7c00f2fd741a5e855d957b8a36854a3250b3117db4066ba9a11b267

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.4.5-py312-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.4.5-py312-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3.12
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for pyveoliaidf-0.4.5-py312-none-any.whl
Algorithm Hash digest
SHA256 d57b20b179e4a2e08d11a559bcd9536e322e4a890561d54c0bd039b6dd5bbc55
MD5 d7ada1aca8da625db1d116db2cf403d7
BLAKE2b-256 a8aba7c46f42e70a2bceb721b61968c93e0df29a0c786901cd2310a0f8dd8dd1

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.4.5-py311-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.4.5-py311-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.11
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for pyveoliaidf-0.4.5-py311-none-any.whl
Algorithm Hash digest
SHA256 edfe03fc0100593f2bc39cca77075f4c8598cde388a5192cd567f18055ab59ad
MD5 bf169c74874d7628a5e6407aa622025e
BLAKE2b-256 d45e7c122ee2c7d35792752603cc5675f111ddc8e94d37195173fc6f23300ffb

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.4.5-py310-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.4.5-py310-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for pyveoliaidf-0.4.5-py310-none-any.whl
Algorithm Hash digest
SHA256 a44d4108c7561df3718a56b1bba54325196a6b0977187fb0093b03fe320ead99
MD5 c8868cafbe419ed556af26e889d03386
BLAKE2b-256 b3960b4bc0ab1371f3c51baef4687747a4151ff868327079d4a1d5bc39a532ee

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.4.5-py39-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.4.5-py39-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for pyveoliaidf-0.4.5-py39-none-any.whl
Algorithm Hash digest
SHA256 9fda7dd084dcd99bf7265ecdb3d9e59f2e90feecdd300792840eb9900e4dbdb9
MD5 38dfbc659eebdcdca62623c87f1d625d
BLAKE2b-256 ea8544649d642d7214f9fd22c6112c83ce9ccb76a8c37f5abba201e2998fcb1d

See more details on using hashes here.

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