Python API wrapper for the WattTime API
Project description
WattTime-API-Wrapper
Python API wrapper for the WattTime API: https://www.watttime.org/api-documentation
Key Features
- Full support for all endpoints and parameters.
- Automatically update API key once it has expired (every 30 mins).
- Built in rate limiting to comply with WattTime API ussage guidelines (3000 requests/5 mins)
- Increased performance by reusing session object accross requests.
- Additional QoL features to facilitate working with response data.
Register Account
from WattTime import WattTime
username = "{USERNAME}"
password = "{PASSWORD}"
email = "{EMAIL_ADDRESS}"
org = "{ORG_NAME}"
wt = WattTime.RegisterNewUser(username, password, email)
Create a Client
- After you have registered for an account, save your username and password as environment variables.
from WattTime import WattTime
import os
username = os.getenv("WATTTIME_API_USERNAME")
password = os.getenv("WATTTIME_API_PASSWORD")
wt = WattTime.GridEmissionsInformation(username, password)
Use the Client
Determine Grid Region
latitude = 33.844978
longitude = -118.387238
wt.determine_grid_region(latitude, longitude)
The output is similar to the following:
> {'abbrev': 'CAISO_LONGBEACH', 'name': 'California ISO Long Beach', 'id': 233}
- For a full list of ussage examples, see the WattTime API Demo.ipynb notebook that has been included in this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for watttime-api-wrapper-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d22ff0486c440e26a34defdbeb675dfd5813ef629933f6f6f22d208bea4c6d |
|
MD5 | f588ae45031419cbf94f07ee91201b7c |
|
BLAKE2b-256 | d02a7c3c5d533d5bb6f321dda5d6721689e4c4a0bc1b626449d1634f16dd29d4 |
Close
Hashes for watttime_api_wrapper-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83d88f2406711e15aec47333e556f6a1833a8482afc90ccaec56f3220b1f04fe |
|
MD5 | 882596c0ba39b39ef6d56ab9ef1b8c23 |
|
BLAKE2b-256 | 06a86a5c12738266426290e3fc42548efd35bc67f4018c45565a671b13d86d32 |