skillfed

opower

A Python library for getting historical and forecasted usage/cost from utilities that use opower.com such as PG&E

opower v0.19.0 77.2K downloads/30d#14,553 on PyPI106
Permissive license Apache-2.0 Active released

What it is and what it does

opower is a Python library that connects to utility company websites powered by the Opower platform to retrieve your historical energy usage and cost data, plus forecasts. It wraps the authentication and API calls needed to pull this information from dozens of US utilities—including major providers like PG&E, ComEd, Exelon subsidiaries, and many regional cooperatives. The library is async-first and designed to work with Home Assistant, making it useful for home energy monitoring and automation.

The package depends on aiohttp for HTTP requests, arrow for date handling, aiozoneinfo for timezone support, and pyotp for two-factor authentication. It includes both a Python API and a command-line tool. Since utilities change their authentication and API endpoints over time, the library is actively maintained to keep up with those changes.

Use it for:

  • Integrate real-time energy usage and cost forecasts into Home Assistant for home automation dashboards
  • Build personal energy monitoring tools that track consumption trends across multiple utility accounts
  • Automate billing alerts or notifications when forecasted costs exceed a threshold
  • Export historical usage data for analysis or comparison with solar/renewable generation systems
  • Feed utility data into smart home routines that adjust heating/cooling based on cost forecasts

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Fetches historical and forecasted energy usage and cost data from utility companies that use the Opower platform, supporting dozens of US utilities through their web APIs.

Yes, if you have an account with a supported US utility and want programmatic access to your usage and cost data. The library is actively maintained, has no known vulnerabilities, installs cleanly, and is purpose-built for this task. The main gotcha is that it requires Python 3.11+ and async code; if your utility isn't listed, you'd need to contribute support for it.

Install

opower on PyPI

pip

pip install opower

uv

uv add opower

poetry

poetry add opower

Installing opower

Before you install

Low friction install with a pure-Python wheel. Actively maintained with a recent release (19 days old) and steady commit activity. Requires Python 3.11 or later.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must retain license notices in distributions.

Quickstart

pip install opower

import asyncio
from opower import Opower

async def get_usage():
    async with Opower(username='user', password='pass', utility='pge') as opower:
        usage = await opower.get_historical_usage()
        return usage

asyncio.run(get_usage())

Requires Python 3.11+. Async-only API; must be called within an async context.

Verify before relying

  • Whether all listed utilities remain actively supported or if some have been deprecated
  • Rate limits or throttling policies enforced by individual utility providers
  • Data freshness guarantees (how often historical and forecast data are updated)

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 4 — aiohttp, aiozoneinfo, arrow, pyotp
Maintenance actively maintained — 19 days since the last release
Last repo commit
First released
Downloads 77,163/month — #14,553 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opower-0.19.0-py3-none-any.whl

Tags

utility bill data apienergy usage forecastopower integrationelectric bill historyhome energy monitoringutility cost datapower consumption api
energy-monitoringhome-automationasync-api

More Utilities packages