Metadata-Version: 2.4 Name: opower Version: 0.18.5 Summary: A Python library for getting historical and forecasted usage/cost from utilities that use opower.com such as PG&E Author-email: tronikos License: Apache-2.0 Project-URL: Homepage, https://github.com/tronikos/opower Project-URL: Bug Tracker, https://github.com/tronikos/opower/issues Requires-Python: >=3.11 Description-Content-Type: text/markdown License-File: LICENSE Requires-Dist: aiohttp>=3.8 Requires-Dist: aiozoneinfo>=0.1 Requires-Dist: arrow>=1.2 Requires-Dist: pyotp>=2.0 Provides-Extra: test Requires-Dist: pytest; extra == "test" Requires-Dist: pytest-asyncio; extra == "test" Requires-Dist: python-dotenv; extra == "test" Dynamic: license-file # opower [![PyPI Version](https://img.shields.io/pypi/v/opower.svg)](https://pypi.org/project/opower/) A Python library and command-line tool for getting historical and forecasted usage/cost data from utilities that use opower.com. This library is used by the [Opower integration in Home Assistant](https://www.home-assistant.io/integrations/opower/). ## Supported Utilities - American Electric Power (AEP) subsidiaries - AEP Ohio - AEP Texas - Appalachian Power - Indiana Michigan Power - Kentucky Power - Public Service Company of Oklahoma (PSO) - Southwestern Electric Power Company (SWEPCO) - Burbank Water and Power (BWP) - City of Austin Utilities - Consolidated Edison (ConEd) and subsidiaries - Orange & Rockland Utilities (ORU) - Duquesne Light Company (DQE) - Evergy - Eversource - Exelon subsidiaries - Atlantic City Electric - Baltimore Gas and Electric (BGE) - Commonwealth Edison (ComEd) - Delmarva Power - PECO Energy Company (PECO) - Potomac Electric Power Company (Pepco) - Glendale Water and Power (GWP) - National Grid US subsidiaries - National Grid Massachusetts - National Grid NY Long Island - National Grid NY Metro - National Grid NY Upstate - Northern Indiana Public Service Company (NIPSCO) - Pacific Gas & Electric (PG&E) - Portland General Electric (PGE) - Puget Sound Energy (PSE) - Sacramento Municipal Utility District (SMUD) - Seattle City Light (SCL) - Southern Maryland Electric Cooperative (SMECO) - Southwest Gas ## Contributing Contributions are welcome! Please feel free to submit a pull request. ### Adding a New Utility To add support for a new Opower-based utility, follow these steps: 1. **Verify it's an Opower utility:** Use your browser's developer tools on your utility's website. If the network tab shows requests to a domain like `utility.opower.com`, it's a good candidate. 2. **Create a utility file:** Add a new file in `src/opower/utilities` that inherits from `UtilityBase`. Name the file after the utility's website (e.g., `newutility.py` for `newutility.com`). 3. **Respect scraping limitations:** This library is used by Home Assistant and must adhere to its [architecture rules](https://github.com/home-assistant/architecture/blob/master/adr/0004-webscraping.md). A headless browser cannot be a dependency, and HTML parsing is only allowed for the authentication phase. > An exception is made for the authentication phase. An integration is allowed to extract fields from forms. To make it more robust, data should not be gathered by scraping individual fields but instead scrape all fields at once. ## Development environment ```sh python3 -m venv .venv source .venv/bin/activate # for Windows CMD: # .venv\Scripts\activate.bat # for Windows PowerShell: # .venv\Scripts\Activate.ps1 # Install dependencies python -m pip install --upgrade pip python -m pip install -e . # Run pre-commit python -m pip install pre-commit pre-commit install pre-commit run --all-files # Run tests python -m pip install -e ".[test]" pytest # Run command line python -m opower --help # To output debug logs and API responses to a file run: python -m opower -vv 2> out.txt # Build package python -m pip install build python -m build ```