Skip to main content

Unofficial api for the Arizona Salt River Project (SRP) API

Project description

Salt River Project Client

This module provides a Python client for interacting with the Salt River Project (SRP) energy API. It allows users to retrieve energy usage data, billing information, and other related data from SRP.

Usage

Here is an example of how to use the Salt River Project Client:

from saltriverprojectenergyapi import SaltRiverProjectClient

# Initialize the client with your Billing Account and login info
client = SaltRiverProjectClient(
    billing_account="Billing Account Number",
    username="SRP email_address or login name",
    password="SRP password"
)

# Authenticate and Authorize the client.
# This is a boolean return value, so you can verify if the authentication
# and authorisation were successful or not.
is_authorised = client.authorise_login()

# Retrieve energy usage data
# The dates are passed in as string values with the format dd-mm-yyyy
energy_usage_data = client.get_hourly_usage(startDate='01-01-2025', endDate='01-05-2025')
# energy_usage_data is a EnergyUsageData object *See objects/data_classes.py
# Hourly Usage for the object is in the .energy_usage property, which is a List[] type of Hourly Energy Usage data.
for hourly_usage in energy_usage_data.energy_usage:
    print(hourly_usage)
# Weather data does not take any parameters, and just returns a full weather dataset.
weather_data = client.get_daily_weather()
# myWeatherData is a List[WeatherData] * See objects/weather_data.py

# Retrieve outage data for your billing account.
# The Outage Data endpoint does not take any parameters, and returns a SelfOutageData object.
outage_data = client.get_user_outage()
if outage_data.is_in_outage_area:
    print("User is in an outage area.)

Currently supported methods

Currently, this client api supports the following methods.

  1. getHourlyUsage
  2. getDailyWeather
  3. getUserOutage

Features

  • Retrieve energy usage data for a specified date range
  • Retrieve weather data associated with your account

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

saltriverprojectenergyapi-1.0.5.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saltriverprojectenergyapi-1.0.5-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file saltriverprojectenergyapi-1.0.5.tar.gz.

File metadata

File hashes

Hashes for saltriverprojectenergyapi-1.0.5.tar.gz
Algorithm Hash digest
SHA256 8f533dbc2ab377118d7464ee87521d68a022f413c9d2dbc2ce934ba7d4b5c6d3
MD5 7b98df725ca527c5c47ebffa0cd465b4
BLAKE2b-256 26464c742b158a414dcb8daa2eba6d4a1111e2424c7bc7edad69770dcec419f3

See more details on using hashes here.

File details

Details for the file saltriverprojectenergyapi-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for saltriverprojectenergyapi-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a21725a84e9eed7eb03ae99cd40c532cb3da00120e7134b0c0aca9819a25c79f
MD5 feba6efda88d88246c6cf9586f09963d
BLAKE2b-256 840ea581ea281b174b4feb303dbf4e0dac14af9e4f365697f5e589215eb0d1c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page