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',
                         '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.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.

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

Uploaded Source

Built Distributions

pyveoliaidf-0.1.13-py39-none-any.whl (8.1 kB view details)

Uploaded Python 3.9

pyveoliaidf-0.1.13-py38-none-any.whl (8.1 kB view details)

Uploaded Python 3.8

pyveoliaidf-0.1.13-py37-none-any.whl (8.1 kB view details)

Uploaded Python 3.7

pyveoliaidf-0.1.13-py36-none-any.whl (8.1 kB view details)

Uploaded Python 3.6

File details

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

File metadata

  • Download URL: pyveoliaidf-0.1.13.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for pyveoliaidf-0.1.13.tar.gz
Algorithm Hash digest
SHA256 20148b328bba9e77e01d397fcbd95d5332295648796ca978e640524c28ffd97f
MD5 cfbc979e68eafe3324d1d82027bb22f8
BLAKE2b-256 bf41f4949096b3cbb778d280b124fdce4aeb10f99c40be4619460c991bc6698c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyveoliaidf-0.1.13-py39-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for pyveoliaidf-0.1.13-py39-none-any.whl
Algorithm Hash digest
SHA256 e9e12c5fdeedcf6c4ab281e040e579f460d06f53332a61fc4ceeb88428d63534
MD5 0e5abb2b03cef5f13390f360fba7d2c7
BLAKE2b-256 8f28d1fda43b768e7faff3132b5db39c0c22c8465a63028db1fc2c5aebc97857

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.1.13-py38-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.1.13-py38-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for pyveoliaidf-0.1.13-py38-none-any.whl
Algorithm Hash digest
SHA256 ce213bb897319b778ceace2ca36c78417b60e0f8714999bd805ff4a772715e81
MD5 4339e487b8c9dd6bbfed1e7111cbc72a
BLAKE2b-256 049bd05ea1ea31653cc804d4fd6f07e783406a5793833ba969978c3642b6ec1b

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.1.13-py37-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.1.13-py37-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3.7
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for pyveoliaidf-0.1.13-py37-none-any.whl
Algorithm Hash digest
SHA256 274eee796f4175e120dfe6c9eeb00bfd59fa9c42126e0e5df4f851db54269121
MD5 64fbdc146a20a6324dc01381950cd24a
BLAKE2b-256 f04bd3efae79237e20997cf0c06d5abd411bd37f18d457cca3591e8654514f5c

See more details on using hashes here.

File details

Details for the file pyveoliaidf-0.1.13-py36-none-any.whl.

File metadata

  • Download URL: pyveoliaidf-0.1.13-py36-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3.6
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for pyveoliaidf-0.1.13-py36-none-any.whl
Algorithm Hash digest
SHA256 f6262ee920bfb98d7d5d053f577e78b687d3b4c4cb8870325f39eb636ae903b8
MD5 9324a51b44729539233981ba09c5bd82
BLAKE2b-256 55baa6dab65b88dd52f1375e74f930b9686fb27056b1bd56ba4f005331c0272c

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