pyveoliaidf


Namepyveoliaidf JSON
Version 0.3.4 PyPI version JSON
download
home_pagehttps://github.com/ssenart/pyveoliaidf
SummaryRetrieve water consumption from Veolia Ile-de-France web site (French Water Company)
upload_time2024-01-27 14:29:53
maintainer
docs_urlNone
authorStephane Senart
requires_python>=3.9
licenseMIT
keywords resource water meter consumption veolia ile-de-france
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://www.mozilla.org/fr/firefox/new)

#### Firefox Web Driver (geckodriver) installation
Follow instructions [here](https://github.com/mozilla/geckodriver/releases)

### Create your virtual environment
```bash
$ pip install virtualenv

$ cd /path/to/my_project_folder/

$ virtualenv venv
```

### PyVeoliaIDF installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install PyVeoliaIDF.

```bash
pip install pyveoliaidf
```

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

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

## Usage

### Command line

```bash
$ 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

```python
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

```json
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](https://choosealicense.com/licenses/mit/)

## Project status
PyVeoliaIDF has been initiated for integration with [Home Assistant](https://www.home-assistant.io/).

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [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.

[0.1.12]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.11...0.1.12
[0.1.11]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.10...0.1.11
[0.1.10]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.9...0.1.10
[0.1.9]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.8...0.1.9
[0.1.8]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.7...0.1.8

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ssenart/pyveoliaidf",
    "name": "pyveoliaidf",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "Resource,Water,Meter,Consumption,Veolia,Ile-de-France",
    "author": "Stephane Senart",
    "author_email": "stephane.senart@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d5/08/2f5dbba001495cb768a8ebb6af2f201c266805dfcaebe27441dff91ac875/pyveoliaidf-0.3.4.tar.gz",
    "platform": "any",
    "description": "# PyVeoliaIDF\nPyVeoliaIDF is a Python library for getting water consumption from Veolia French provider.\n\nTheir water meter are wireless and transmit the consumption once per day.\n\nAll consumption data is available on the client account at Veolia Web Site (https://espace-client.vedif.eau.veolia.fr).\n\nPyVeoliaIDF automatically go through the Web Site and download the consumption data CSV file, and make it available in a Python structure (list of dictionaries).\n\n## Installation\n\n### Requirements\nPyVeoliaIDF 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.\n\nPyVeoliaIDF has been developped and tested with Firefox browser (version 68.8) and its corresponding Web Driver geckodriver (version 0.24).\n\n#### Firefox browser installation\nFollow instructions [here](https://www.mozilla.org/fr/firefox/new)\n\n#### Firefox Web Driver (geckodriver) installation\nFollow instructions [here](https://github.com/mozilla/geckodriver/releases)\n\n### Create your virtual environment\n```bash\n$ pip install virtualenv\n\n$ cd /path/to/my_project_folder/\n\n$ virtualenv venv\n```\n\n### PyVeoliaIDF installation\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install PyVeoliaIDF.\n\n```bash\npip install pyveoliaidf\n```\n\nYou can also download the source code and install it manually.\n\n```bash\ncd /path/to/pyveoliaidf/\npython setup.py install\n```\n\n## Usage\n\n### Command line\n\n```bash\n$ 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)'\n```\n\n### Library\n\n```python\nimport pyveoliaidf\n\nclient = pyveoliaidf.Client('your login',\n                         'your password',\n                         365,\n                         'path/to/Selenium Web Driver',\n                         30,\n                         'temporary directory where to store CSV file (ex: /tmp)')\n\nclient.update()\n\ndata = client.data()\n```\n\n### Output\n\n```json\ndata =>\n[\n  {\n    \"time\": \"2019-07-14 19:00:00\",\n    \"total_liter\": \"506669\",\n    \"daily_liter\": \"530\",\n    \"type\": \"Estim\\u00c3\\u00a9\",\n    \"timestamp\": \"2019-08-31T16:55:01.236779\"\n  },\n  {\n    \"time\": \"2019-07-15 19:00:00\",\n    \"total_liter\": \"507523\",\n    \"daily_liter\": \"854\",\n    \"type\": \"Mesur\\u00c3\\u00a9\",\n    \"timestamp\": \"2019-08-31T16:55:01.236779\"\n  },\n  {\n    \"time\": \"2019-07-16 19:00:00\",\n    \"total_liter\": \"508314\",\n    \"daily_liter\": \"791\",\n    \"type\": \"Mesur\\u00c3\\u00a9\",\n    \"timestamp\": \"2019-08-31T16:55:01.236779\"\n  }\n]\n```\n\n## Limitation\nPyVeoliaIDF relies on how Veolia Web Site is built. It goes through each Web pages and automatically fill forms, click buttons using their internal identifiers.\n\nAny change in the Web site structure or identifier naming may break this library.\n\nWe expect in close Future that Veolia makes available a standard API from which we can get safely their data.\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Project status\nPyVeoliaIDF has been initiated for integration with [Home Assistant](https://www.home-assistant.io/).\n\n# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [0.3.4] - 2024-01-27\n\n### Fixed\n- Set the correct firefox location for Linux.\n\n## [0.3.3] - 2024-01-27\n\n### Fixed\n- Fix wrong Selenium version in setup.cfg.\n\n## [0.3.2] - 2024-01-27\n\n### Fixed\n- Add Python 3.11 and 3.12 support.\n\n## [0.3.1] - 2024-01-27\n\n### Fixed\n- Fix lint error: W291 trailing whitespace\n\n## [0.3.0] - 2024-01-27\n\n### Fixed\n- The Web site has changed some component xpath.\n\n### Changed\n- Upgrade Selenium version to 4.17.2\n- Upgrade Geckodriver version to 0.34.0\n\n## [0.2.1] - 2023-02-05\n\n### Fixed\n- The Web site has changed some component xpath. \n\n## [0.2.0] - 2022-10-17\n\n### Added \n- Add a new parameter 'lastNDays' that permits to control how many days of data we want to retrieve.\n\n### Fixed\n- Add some means that permits to log every Selenium actions.\n- Add some controls on the downloaded data file (check its content) before processing it.\n\n## [0.1.13] - 2021-12-03\n### Fixed\n- Increase waiting time after selection of 'Jours' and 'Litres' buttons. Sometimes, we get only a partial set of data with missing most recent ones.\n\n## [0.1.12] - 2020-10-12\n### Fixed\n- The Veolia login email text box has changed its identifier.\n\n## [0.1.11] - 2020-10-03\n### Fixed\n- 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.\n\n## [0.1.10] - 2020-10-03\n### Fixed\n- The VeoliaIDF web site has changed and added some buttons to select the consumption period and the consumption unit.\n\n## [0.1.9] - 2019-08-31\n### Fixed\n- WebDriver window size must be large enough to display all clickable components.\n\n## [0.1.8] - 2019-08-31\n### Added\n- Use PropertyNameEnum type to store all property names.\n- Add LoginError exception raised when PyVeoliaIDF is unable to sign in the Veolia Web site with the given username/password.\n- Add timestamp property that contains date/time when the data has been retrieved.\n\n[0.1.12]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.11...0.1.12\n[0.1.11]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.10...0.1.11\n[0.1.10]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.9...0.1.10\n[0.1.9]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.8...0.1.9\n[0.1.8]: https://github.com/ssenart/PyVeoliaIDF/compare/0.1.7...0.1.8\n\nMIT License\n\nCopyright (c) 2019 St\u00e9phane Senart\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Retrieve water consumption from Veolia Ile-de-France web site (French Water Company)",
    "version": "0.3.4",
    "project_urls": {
        "Changelog": "https://github.com/ssenart/pyveoliaidf/blob/master/CHANGELOG.md",
        "Download": "https://pypi.org/project/pyveoliaidf",
        "Home": "https://github.com/ssenart/pyveoliaidf",
        "Homepage": "https://github.com/ssenart/pyveoliaidf",
        "Issues": "https://github.com/ssenart/pyveoliaidf/issues",
        "Source": "https://github.com/ssenart/pyveoliaidf"
    },
    "split_keywords": [
        "resource",
        "water",
        "meter",
        "consumption",
        "veolia",
        "ile-de-france"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0f4d3239dd131465f16f89313e5c15c0766fbfa8b3a36289657f36c08c2d3b8",
                "md5": "abaf988e0792c8c6c47432651e22f914",
                "sha256": "7dabb2b5db168f76953983a187051de6e8728f5a4386f1c23ff0042a1248b521"
            },
            "downloads": -1,
            "filename": "pyveoliaidf-0.3.4-py310-none-any.whl",
            "has_sig": false,
            "md5_digest": "abaf988e0792c8c6c47432651e22f914",
            "packagetype": "bdist_wheel",
            "python_version": "py310",
            "requires_python": ">=3.9",
            "size": 12499,
            "upload_time": "2024-01-27T14:30:09",
            "upload_time_iso_8601": "2024-01-27T14:30:09.497910Z",
            "url": "https://files.pythonhosted.org/packages/e0/f4/d3239dd131465f16f89313e5c15c0766fbfa8b3a36289657f36c08c2d3b8/pyveoliaidf-0.3.4-py310-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "824df05defdf9759f45eea284a5d2d1fd17c37ffe6d28bbac21a2368a4022d8c",
                "md5": "d1c124529a09b2f64c9cf64b65a8ebb5",
                "sha256": "39d525ae822d2adb61b082dc981feebbd15dd42f509612ab0fd50b14cda916a9"
            },
            "downloads": -1,
            "filename": "pyveoliaidf-0.3.4-py311-none-any.whl",
            "has_sig": false,
            "md5_digest": "d1c124529a09b2f64c9cf64b65a8ebb5",
            "packagetype": "bdist_wheel",
            "python_version": "py311",
            "requires_python": ">=3.9",
            "size": 12497,
            "upload_time": "2024-01-27T14:29:51",
            "upload_time_iso_8601": "2024-01-27T14:29:51.782304Z",
            "url": "https://files.pythonhosted.org/packages/82/4d/f05defdf9759f45eea284a5d2d1fd17c37ffe6d28bbac21a2368a4022d8c/pyveoliaidf-0.3.4-py311-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3bcb4c9e28cbf7b59f29613b2f85d139ef51bed3d3d04928776d654e779f693b",
                "md5": "7b7012d5863dfd5e1505f74db7dc170b",
                "sha256": "1ab81735ec85e7032fd0ff76aa554ad78b46ea0b747d631750fc39ecc3d0d573"
            },
            "downloads": -1,
            "filename": "pyveoliaidf-0.3.4-py312-none-any.whl",
            "has_sig": false,
            "md5_digest": "7b7012d5863dfd5e1505f74db7dc170b",
            "packagetype": "bdist_wheel",
            "python_version": "py312",
            "requires_python": ">=3.9",
            "size": 12498,
            "upload_time": "2024-01-27T14:30:19",
            "upload_time_iso_8601": "2024-01-27T14:30:19.324412Z",
            "url": "https://files.pythonhosted.org/packages/3b/cb/4c9e28cbf7b59f29613b2f85d139ef51bed3d3d04928776d654e779f693b/pyveoliaidf-0.3.4-py312-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "114e6629f944841a3ebe58d5c79142291d73e01d204bac71e111029e9cd0fd6f",
                "md5": "85b56c2402773431c51a3cf173fe0dee",
                "sha256": "dd2afd5bf4f6a02bf35a8d4ed79ea2d96b171b597d415448ff772c9262be4248"
            },
            "downloads": -1,
            "filename": "pyveoliaidf-0.3.4-py39-none-any.whl",
            "has_sig": false,
            "md5_digest": "85b56c2402773431c51a3cf173fe0dee",
            "packagetype": "bdist_wheel",
            "python_version": "py39",
            "requires_python": ">=3.9",
            "size": 12497,
            "upload_time": "2024-01-27T14:30:27",
            "upload_time_iso_8601": "2024-01-27T14:30:27.371212Z",
            "url": "https://files.pythonhosted.org/packages/11/4e/6629f944841a3ebe58d5c79142291d73e01d204bac71e111029e9cd0fd6f/pyveoliaidf-0.3.4-py39-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d5082f5dbba001495cb768a8ebb6af2f201c266805dfcaebe27441dff91ac875",
                "md5": "b42186d17ebd25a5706ecaa918583c91",
                "sha256": "982e0c3fbfbec6b2217808fdd3a3928ec6f7d971766c4263abad63a7eed29ea0"
            },
            "downloads": -1,
            "filename": "pyveoliaidf-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b42186d17ebd25a5706ecaa918583c91",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 13082,
            "upload_time": "2024-01-27T14:29:53",
            "upload_time_iso_8601": "2024-01-27T14:29:53.389355Z",
            "url": "https://files.pythonhosted.org/packages/d5/08/2f5dbba001495cb768a8ebb6af2f201c266805dfcaebe27441dff91ac875/pyveoliaidf-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-27 14:29:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ssenart",
    "github_project": "pyveoliaidf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pyveoliaidf"
}
        
Elapsed time: 0.37891s