comed-hourly-pricing
Async Python library to retrieve ComEd BESH (Basic Electric Service–Hourly) supply-rate pricing, both the estimated and the actual settled prices.
Prices are exposed as dollars/kWh (floats). The upstream feed reports cents/kWh (e.g. 1.8¢ → 0.018).
Endpoints
HTML ServletFeed (hourly BESH rates)
| Method | Source feed | Columns |
|---|---|---|
get_dual(day) |
pricingtabledual&date=YYYYMMDD |
hour-ending, estimated, actual settled (n/a until settled) |
get_next_day() |
pricingtabledaynexttomorrow |
hour-ending, estimated (empty until ~4:30pm Central) |
Timestamps mark the end of the hour and are timezone-aware in America/Chicago.
JSON API (live real-time pricing)
| Method | Source feed | Returns |
|---|---|---|
get_five_minute_feed(start, end) |
api?type=5minutefeed |
tuple[PricePoint, ...] — last 24h by default, or a custom range |
get_current_hour_average() |
api?type=currenthouraverage |
PricePoint | None |
start/end are optional Central-local datetimes (sent as YYYYMMDDhhmm).
See ComEd's API documentation for details.
Install / run
uv sync
Usage
import asyncio
from comed_hourly_pricing import Client
async def main():
async with Client() as client:
today = await client.get_dual() # defaults to today (Central)
for hour in today.settled:
print(hour.hour_ending, hour.estimated, hour.actual)
tomorrow = await client.get_next_day()
if not tomorrow:
print("Next-day prices not published yet.")
recent = await client.get_five_minute_feed() # last 24h, 5-min points
for point in recent:
print(point.timestamp, point.price)
now = await client.get_current_hour_average()
if now:
print("Current hour avg:", now.price)
asyncio.run(main())
You may also pass your own session: Client(session=my_session) — a borrowed session is never closed by the client.
Data model
HourlyPrice(hour_ending: datetime, estimated: float | None, actual: float | None)— one hour's row.HourlyDayPrices(date, hours)— returned byget_dual; iterable/len/bool, plus.settledand.unsettledviews.HourlyNextDayEstimatedPrices(date, hours)— returned byget_next_day; estimate-only (every row'sactualisNone).PricePoint(timestamp: datetime, price: float)— one live JSON-API reading;timestampis tz-awareAmerica/Chicago,priceis dollars/kWh. Returned byget_five_minute_feed(a tuple) andget_current_hour_average(one, orNone).
CLI
uv run python -m comed_hourly_pricing --date 2026-08-02 # dual feed for a date
uv run python -m comed_hourly_pricing --next-day # next-day estimates
uv run python -m comed_hourly_pricing --five-minute # last 24h 5-minute feed
uv run python -m comed_hourly_pricing --current-hour # current-hour average
Polling
These feeds should not be polled frequently. Each method makes a single request. Throttling is the caller's responsibility.
Tests
uv run pytest
Tests run fully offline against captured fixtures in tests/fixtures/.
Development
Requires Python ≥ 3.13 and aiohttp.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file comed_hourly_pricing-0.1.0.tar.gz.
File metadata
- Download URL: comed_hourly_pricing-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e54c14ac0782152cfa4b23d2768fb5dcf1f7e2d9a0227b4bf78171c402449b0
|
|
| MD5 |
727946f26e59ba16135aa34f1191bb60
|
|
| BLAKE2b-256 |
5cce988d8be157df0b897df1adc4605c73ac9b136f64fb33b8f89c5d4754e265
|
Provenance
The following attestation bundles were made for comed_hourly_pricing-0.1.0.tar.gz:
Publisher:
pypi.yml on jjlawren/comed-hourly-pricing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
comed_hourly_pricing-0.1.0.tar.gz -
Subject digest:
0e54c14ac0782152cfa4b23d2768fb5dcf1f7e2d9a0227b4bf78171c402449b0 - Sigstore transparency entry: 2520962014
- Sigstore integration time:
-
Permalink:
jjlawren/comed-hourly-pricing@b3c52bb9d1df78a523ea0f57ff1e053848087932 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jjlawren
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@b3c52bb9d1df78a523ea0f57ff1e053848087932 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file comed_hourly_pricing-0.1.0-py3-none-any.whl.
File metadata
- Download URL: comed_hourly_pricing-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df4dbb1bdbd84e9bfeca736757fe946a09671aa76aea29a0664059c2bf7c382c
|
|
| MD5 |
594559b1d8ebdd715ecad55082c025f5
|
|
| BLAKE2b-256 |
a094076e7593acfa85af11030469e5cb83bd6d6070511ee9569706e7539701a4
|
Provenance
The following attestation bundles were made for comed_hourly_pricing-0.1.0-py3-none-any.whl:
Publisher:
pypi.yml on jjlawren/comed-hourly-pricing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
comed_hourly_pricing-0.1.0-py3-none-any.whl -
Subject digest:
df4dbb1bdbd84e9bfeca736757fe946a09671aa76aea29a0664059c2bf7c382c - Sigstore transparency entry: 2520962169
- Sigstore integration time:
-
Permalink:
jjlawren/comed-hourly-pricing@b3c52bb9d1df78a523ea0f57ff1e053848087932 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jjlawren
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@b3c52bb9d1df78a523ea0f57ff1e053848087932 -
Trigger Event:
workflow_dispatch
-
Statement type: