{ "info": { "author": "Paul D.Smith", "author_email": "paul@pauldsmith.org.uk", "bugtrack_url": null, "classifiers": [], "description": "====================\nthameswater |builds|\n====================\nDisclaimer: I have no connection to `Thames Water`_ at all (other than a water supply and sewage pipe ;-) ) and this is a utility that I wrote because I was frustrated that I could not download this information directly from the website.\n\n\n\nWhat It Does\n------------\nThis is a Python utility that allows you to download your daily water usage, over the last 6 months, from the `Thames Water`_ website and produce a comma separated values (CSV) file that you can import into a spreadsheet or use in whatever way you wish.\n\nUnder the covers the utility uses the `Chrome browser`_ to surf the `Thames Water`_ website and download the information that you want.\n\nInstallation\n------------\nYou will need both the `Chrome browser`_ and the `ChromeDriver - WebDriver for Chrome`_. The `ChromeDriver - WebDriver for Chrome`_ allows this Python application to drive the Chrome browser just as if you were sat their typing and clicking links \\\u2013 you can sit and watch this happen if you like by not running this script 'headless'.\n\nSo install the `Chrome browser`_ if you haven't already and then copy the `ChromeDriver - WebDriver for Chrome`_ to somewhere on your system before installing this utility.\n\nIt is recommended that you install the utility into either Virtualenv_ or Venv_ environment and you must use Python3_ not Python2_. Once the environment is created, the following should install this utility:\n::\n\n $ pip install thameswater\n\n\nThe thameswater application can then be run to download your daily water usage data.\n\nUsage\n-----\n::\n\n usage: thameswater.py [-h] --login LOGIN --password PASSWORD --driver DRIVER\n [--headless] --csv CSV\n\n Read daily water usage data from the Thames Water website and write it out to\n a CSV file.\n\n optional arguments:\n -h, --help show this help message and exit\n --login LOGIN your Thames Water login e-mail address\n --password PASSWORD your Thames Water login password\n --driver DRIVER location of browser driver e.g. chromedriver\n --headless use headless browser\n --csv CSV Name of CSV file to be written\n\nYou probably want to create a batch/shell script to avoid having to type the longish command line each time.\n\nIt Went Wrong!\n--------------\nVery occasionally it does, normally because the `Thames Water`_ website has stopped responding in a timely manner; go make a cup of tea and try later because there\u2019s nothing you or I can do about that!\n\nUnder the Covers\n----------------\nThe Python script uses Selenium_ to drive the `Chrome browser`_ via the `ChromeDriver - WebDriver for Chrome`_. It then runs around the Thames Water website just as you would, including logging in using the e-mail address and password that you provided, until it reaches the \u2018Daily Usage\u2019 page.\n\nIt turns out that in order to show the daily bar charts, the `Thames Water`_ website downloads the last 6 months of daily usage in a JSON encoded file, which this script gets hold of, tweaks the dates into a more sensible format and then writes out to the CSV file. The JSON file is accessed via Chrome\u2019s performance data, the data that Chrome uses to show network access if you watch your browsing with the Developer Tools open.\n\nWhy Chrome?\n-----------\n* It's the browser that I normally use; the code might well work with Firefox and the Firefox driver or perhaps even Edge or other browsers, providing a suitable Selenium driver is available.\n* Chrome can be run in 'headless' mode which is nice if you don't want a browser to launch onto your desktop just to download these figures.\n\nDebugging/Logging\n-----------------\nAt the time of writing you will see the following log appearing on screen:\n::\n\n DevTools listening on ws://127.0.0.1...\n\nThere does not appear to be a way to suppress this at present but if you find one, please let me know.\n\n.. _Thames Water: https://www.thameswater.co.uk\n.. _`Chrome browser`: https://www.google.com/chrome/\n.. _pypi: https://pypi.org/thameswater\n.. _Selenium: http://selenium-python.readthedocs.io/\n.. _ChromeDriver - WebDriver for Chrome: https://sites.google.com/a/chromium.org/chromedriver/downloads\n.. _Virtualenv: https://virtualenv.pypa.io/en/stable/\n.. _Venv: https://docs.python.org/3/library/venv.html\n.. _Python3: https://www.python.org/downloads/\n.. _Python2: Python3_\n.. |builds| image:: https://travis-ci.org/papadeltasierra/thameswater.svg?branch=master", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/papadeltasierrra/thameswater", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "thameswater", "package_url": "https://pypi.org/project/thameswater/", "platform": "", "project_url": "https://pypi.org/project/thameswater/", "project_urls": { "Homepage": "https://github.com/papadeltasierrra/thameswater" }, "release_url": "https://pypi.org/project/thameswater/0.5/", "requires_dist": null, "requires_python": "", "summary": "An application for dowloading daily water usage data from Thames Water (UK).", "version": "0.5" }, "last_serial": 5288430, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e98f16f29ce58609c3f53fe78c122ad6", "sha256": "7cd9583dfe195da366233df87f935b35000c093d6a30f8df03b3c023d470e696" }, "downloads": -1, "filename": "thameswater-0.1.tar.gz", "has_sig": false, "md5_digest": "e98f16f29ce58609c3f53fe78c122ad6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5949, "upload_time": "2018-04-08T12:06:01", "url": "https://files.pythonhosted.org/packages/3b/07/6f6125e19fc941cc636095fbac6d0650a651988df11f10b0dc066f66df19/thameswater-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ae7130e342e39fda3177d0543dab7401", "sha256": "8c84e4a2965b7ed2999891725dc26321529ddc4081361b46a1af838dc41ad131" }, "downloads": -1, "filename": "thameswater-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ae7130e342e39fda3177d0543dab7401", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6280, "upload_time": "2019-03-10T13:14:50", "url": "https://files.pythonhosted.org/packages/23/25/bdd97c9bc355907a0f651f1d3250179a0206cbcc061677e57714b3faa340/thameswater-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e3e54b9dfffb254f453323e14c562973", "sha256": "154acd4c282bba9a22ec3297fab83d25031d302a440852eaf5021bad94eff515" }, "downloads": -1, "filename": "thameswater-0.2.tar.gz", "has_sig": false, "md5_digest": "e3e54b9dfffb254f453323e14c562973", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5960, "upload_time": "2018-06-17T14:23:07", "url": "https://files.pythonhosted.org/packages/bd/48/aacfb3b811ff1383ada6234784871d469da10fa32731c16f8a6c147fe01f/thameswater-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "632d88ae5eb348c5575652cf9f649229", "sha256": "a7f43d38e530991a311ab4cd4552cbb99e1bf5d43c67d9ae94813a4b07c14e67" }, "downloads": -1, "filename": "thameswater-0.3.tar.gz", "has_sig": false, "md5_digest": "632d88ae5eb348c5575652cf9f649229", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6107, "upload_time": "2019-03-10T13:15:31", "url": "https://files.pythonhosted.org/packages/bf/ae/34980c425dd292afe74ef374143abb2fc95f400da38a0e2b6151f0305a45/thameswater-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "909d551682979b03f24a2ac34045b6ff", "sha256": "f78cfa1d43dc4e51d823a184ad8f6222064ef05ee97e47a69ad3bed6885aab43" }, "downloads": -1, "filename": "thameswater-0.4.tar.gz", "has_sig": false, "md5_digest": "909d551682979b03f24a2ac34045b6ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6066, "upload_time": "2019-03-10T13:23:55", "url": "https://files.pythonhosted.org/packages/48/a4/f7d28af9d22e9dbbbe16edbed481f859cf0b24ffc663bff354180a83ee62/thameswater-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "93140855fde1bccafab86bf0923c02ca", "sha256": "69795ef81639a269a56080236e235b844409b8edb2d08c70a40cd6e6b3c04064" }, "downloads": -1, "filename": "thameswater-0.5.tar.gz", "has_sig": false, "md5_digest": "93140855fde1bccafab86bf0923c02ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6036, "upload_time": "2019-05-19T14:21:14", "url": "https://files.pythonhosted.org/packages/ec/be/ffd5cef37e79bc0a42428a3348949f4726ac7a7a0f0b95dba00f400c4872/thameswater-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93140855fde1bccafab86bf0923c02ca", "sha256": "69795ef81639a269a56080236e235b844409b8edb2d08c70a40cd6e6b3c04064" }, "downloads": -1, "filename": "thameswater-0.5.tar.gz", "has_sig": false, "md5_digest": "93140855fde1bccafab86bf0923c02ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6036, "upload_time": "2019-05-19T14:21:14", "url": "https://files.pythonhosted.org/packages/ec/be/ffd5cef37e79bc0a42428a3348949f4726ac7a7a0f0b95dba00f400c4872/thameswater-0.5.tar.gz" } ] }