Skip to main content

Green Mountain Power

This is an unofficial Python client that uses the undocumented API for Green Mountain Power accounts.

Quickstart

To start using this client, install it using pip.

pip3 install greenmountainpower

And then import the client and use it to fetch usage data.

import datetime
import greenmountainpower

print("Collecting usage...")

gmp = greenmountainpower.api.GreenMountainPowerApi(
    account_number=58504395849, username="jsmith", password="mypassword"
)

now = datetime.datetime.now()
one_day_ago = now - datetime.timedelta(days=1)
usages = gmp.get_usage(
    precision=greenmountainpower.api.UsagePrecision.HOURLY,
    start_time=one_day_ago,
    end_time=now,
)

for usage in usages:
    print(f" - Time: {usage.start_time.isoformat()}, Usage: {usage.consumed_kwh} KWH")

Output:

Collecting usage...
 - Time: 2021-11-14T01:00:00, Usage: 0.27 KWH
 - Time: 2021-11-14T02:00:00, Usage: 0.22 KWH
 - Time: 2021-11-14T03:00:00, Usage: 0.24 KWH
 - Time: 2021-11-14T04:00:00, Usage: 0.25 KWH
 - Time: 2021-11-14T05:00:00, Usage: 0.26 KWH
 - Time: 2021-11-14T06:00:00, Usage: 0.26 KWH
 ...

Publishing

To publish a new version, follow these steps.

git tag <version> # ensure all changes are committed
python3 -m build # build the package
twine upload --repository pypi dist/*

Metadata

Release files for greenmountainpower 0.0.6

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

Source distribution (sdist)

Source distribution for greenmountainpower 0.0.6
File Size Uploaded Provenance
greenmountainpower-0.0.6.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 7.6 kB

Release files / greenmountainpower-0.0.6.tar.gz

Download URL greenmountainpower-0.0.6.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
889c9ebf6e66ac36b131f64a7d0a4f137f8daae7aa8731f622570e83df677ae9
BLAKE2b-256 checksum
How to use checksums
b947778616a06edb40aea77000c5d9c181a9b3d80ebb36da584aa98f109fed20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.2

Release files / greenmountainpower-0.0.6-py3-none-any.whl

Download URL greenmountainpower-0.0.6-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72e6157da238db62bad31135780e1877dcdfa90ab60fd10f607442af9d4dc2f7
BLAKE2b-256 checksum
How to use checksums
d82f3dacd90194186609ca709ff485c4d3b652eb2304a12e78e2e88405418cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.2

Security for greenmountainpower 0.0.6

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.

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