Skip to main content

Small client to retrieve the water consumption from Veolia website: https://www.eau-services.com

Remarks

Veolia publishes water consumption with a delay of 3 days. It means if we are the 14, you will be only able to retrieve your data from the 11. To retrieve the hourly water consumption, you have to update your preferences on this page.

Installation

pip install pyolia

Getting started

import asyncio
from datetime import datetime, timedelta

from pyolia.client import VeoliaClient


USERNAME = "your username"
PASSWORD = "your password"

async def main() -> None:
    async with VeoliaClient(USERNAME, PASSWORD) as client:
        now = datetime.now()
        if now.day < 4:
            now = now - timedelta(days=3)
        consumption = await client.get_consumption(now.month, now.year)
        print(consumption)
        now = now - timedelta(days=3)
        consumption = await client.get_consumption(now.month, now.year, now.day)
        print(consumption)


asyncio.run(main())

Development

Installation

  • For Linux, install pyenv using pyenv-installer

  • For MacOS, run brew install pyenv

  • Don't forget to update your .bashrc file (or similar):

    export PATH="~/.pyenv/bin:$PATH"
    eval "$(pyenv init -)"
    
  • Install the required dependencies

  • Install poetry: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

  • Clone this repository

  • cd python-veolia-api

  • Install the required Python version: pyenv install

  • Init the project: poetry install

  • Run poetry run pre-commit install

PyCharm

As IDE you can use PyCharm.

Using snap, run snap install pycharm --classic to install it.

For MacOS, run brew cask install pycharm-ce

Once launched, don't create a new project, but open an existing one and select the python-veolia-api folder.

Go to File | Settings | Project: nre-tag | Project Interpreter. Your interpreter must look like <whatever>/python-veolia-api/.venv/bin/python

Metadata

Release files for pyolia 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyolia 0.4.0
File Size Uploaded
pyolia-0.4.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyolia 0.4.0
File Interpreter ABI Platform
pyolia-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / pyolia-0.4.0.tar.gz

Download URL pyolia-0.4.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b01e128f259393bc814e595c40b367c01f2feb506d52b575a3f96c2ada6f8bd8
BLAKE2b-256 checksum
How to use checksums
fed97b5021701e3f7c9b136caffd8c726ec2647c0fcc4c35ad726da58f1acfe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

Release files / pyolia-0.4.0-py3-none-any.whl

Download URL pyolia-0.4.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
babee76d0be0c63195ec2851da163cfd7f8df4dbe2549caabf50ab6a2ced50ba
BLAKE2b-256 checksum
How to use checksums
b03431a0ee3205709ca2359c913d54c881c12f3784bdab5afe8c3e7644acb6a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page