Documentation
¶
Overview ¶
Package stateprice is a dated, cited table of US average residential electricity prices by state. The guided setup offers a state's average as a one-tap default for the home rate (charging.home_price_source = state_average); the user can always type their own.
The table is the U.S. Energy Information Administration's Electric Power Monthly, Table 5.6.B (average price of electricity to ultimate customers by end-use sector, by state), residential column, year to date. It is refreshed by a pull request: copy the new residential column, bump Period, Released and Checked, and the tests check the shape. Nothing is fetched at run time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Table = Source{
Name: "U.S. EIA, Electric Power Monthly, Table 5.6.B: average price to ultimate customers, residential, year to date",
URL: "https://www.eia.gov/electricity/monthly/epm_table_grapher.php?t=epmt_5_6_b",
Period: "January to August 2026",
Released: "2026-10-23",
Checked: "2026-11-13",
}
Table is the source of the numbers below.
Functions ¶
Types ¶
type Price ¶
type Price struct {
State string `json:"state"` // two-letter code
Name string `json:"name"`
PricePerKWh float64 `json:"price_per_kwh"`
Currency string `json:"currency"`
Source Source `json:"source"`
}
Price is a state's average residential price in US dollars per kWh.
type Source ¶
type Source struct {
Name string `json:"name"`
URL string `json:"url"`
Period string `json:"period"`
Released string `json:"released"` // the date EIA published the table
Checked string `json:"checked"` // the date the numbers were copied here
}
Source describes where the table comes from and how fresh it is.