Skip to main content

toronto-hydro-green-button

Export Green Button (ESPI) energy usage data from your Toronto Hydro account.

Toronto Hydro offers a Green Button XML export through the customer portal, but does not offer programmatic API access. This script logs into the dashboard with Selenium, then downloads the report with Requests.

Requirements

  • a Toronto Hydro account
  • Python 3.6+
  • Firefox 57+ or Google Chrome and ChromeDriver

Installation

Install with pip:

pip install toronto-hydro-green-button

Usage

The script needs your username and password to log into the dashboard. It will check, in order of precedence:

  • --username/-u and --password/-p arguments
  • TORONTO_HYDRO_USERNAME and TORONTO_HYDRO_PASSWORD environment variables
  • prompt input

Use --start-date and --end-date to query data between two dates (inclusive).

$ toronto-hydro-green-button --start-date 2019-11-01 --end-date 2019-11-31

If ChromeDriver is installed, the script attempts to use it by default. Otherwise it falls back on headless Firefox. ChromeDriver was slightly faster in my limited testing.

Run toronto-hydro-green-button --help for additional usage information.

Tips

Toronto Hydro usage data lags by 2–3 days. This script defaults to querying data from two days ago.

If you run this script frequently, you may not always see fresh data. It should be sufficient to run it daily.

License

MIT

Metadata

Release files for toronto-hydro-green-button 0.1.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 toronto-hydro-green-button 0.1.0
File Size Uploaded Provenance Actions
toronto-hydro-green-button-0.1.0.tar.gz 4.1 kB Without provenance Details for toronto-hydro-green-button-0.1.0.tar.gz

Release files / toronto-hydro-green-button-0.1.0.tar.gz

Download URL toronto-hydro-green-button-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
49129bc75ccb3b682ef8ebdf36f8e9244715d97f92a9ab0e92352af309dcdef0
BLAKE2b-256 checksum
How to use checksums
bc1e93f2cc356cde6c9977bd5e5dfe457875c012168b69be5d764f1eae4b7119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9

Security for toronto-hydro-green-button 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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