Gridstatus#

Subpackages#

Submodules#

Package Contents#

Classes Summary#

CAISO

California Independent System Operator (CAISO)

Ercot

Electric Reliability Council of Texas (ERCOT)

ISONE

ISO New England (ISONE)

Markets

Names of LMP Markets

MISO

Midcontinent Independent System Operator (MISO)

NYISO

New York Independent System Operator (NYISO)

PJM

PJM

SPP

Southwest Power Pool (SPP)

Functions#

get_iso

Get an ISO by its id

list_isos

List available ISOs

Contents#

class gridstatus.CAISO[source]#

Bases: gridstatus.base.ISOBase

California Independent System Operator (CAISO)

Attributes

default_timezone

US/Pacific

iso_id

caiso

markets

None

name

California ISO

status_homepage

https://www.caiso.com/TodaysOutlook/Pages/default.aspx

trading_hub_locations

[‘TH_NP15_GEN-APND’, ‘TH_SP15_GEN-APND’, ‘TH_ZP26_GEN-APND’]

Methods

get_fuel_mix

Get fuel mix in 5 minute intervals for a provided day

get_gas_prices

Return gas prices at a previous date

get_ghg_allowance

Return ghg allowance at a previous date

get_lmp

Get day ahead LMP pricing starting at supplied date for a list of locations.

get_load

Return load at a previous date in 5 minute intervals

get_load_forecast

Returns load forecast for a previous date in 1 hour intervals

get_pnodes

get_stats

get_status

Get Current Status of the Grid. Only date="latest" is supported

get_storage

Return storage charging or discharging for today in 5 minute intervals

get_supply

Get supply for a date or date range in hourly intervals

get_fuel_mix(date, end=None, verbose=False)#

Get fuel mix in 5 minute intervals for a provided day

Arguments:

date (datetime or str): “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.

start (datetime or str): start of date range to return. alias for date parameter. Only specify one of date or start.

end (datetime or str): “today” or an object that can be parsed as a datetime for the day to return data. Only used if requesting a range of dates.

verbose (bool): print verbose output. Defaults to False.

Returns:

pd.Dataframe: dataframe with columns: Time and columns for each fuel type

get_gas_prices(date, end=None, fuel_region_id='ALL', sleep=5, verbose=False)#

Return gas prices at a previous date

Arguments:

date: date to return data end: last date of range to return data. if None, returns only date. Defaults to None. fuel_region_id(str, or list): single fuel region id or list of fuel region ids to return data for. Defaults to ALL, which returns all fuel regions.

get_ghg_allowance(date, end=None, sleep=5, verbose=False)#

Return ghg allowance at a previous date

Arguments:

date: date to return data end: last date of range to return data. if None, returns only date. Defaults to None.

get_lmp(date, market: str, locations: list = None, sleep: int = 5, end=None, verbose=False)#

Get day ahead LMP pricing starting at supplied date for a list of locations.

Arguments:

date: date to return data

market: market to return from. supports:

locations(list): list of locations to get data from. If no locations are provided, defaults to NP15, SP15, and ZP26, which are the trading hub locations. For a list of locations, call CAISO.get_pnodes()

sleep(int): number of seconds to sleep before returning to avoid hitting rate limit in regular usage. Defaults to 5 seconds.

Returns

dataframe of pricing data

get_load(date, end=None, verbose=False)#

Return load at a previous date in 5 minute intervals

get_load_forecast(date, end=None, sleep=5, verbose=False)#

Returns load forecast for a previous date in 1 hour intervals

Arguments:

date(datetime, pd.Timestamp, or str): day to return. if string, format should be YYYYMMDD e.g 20200623 sleep(int): number of seconds to sleep before returning to avoid hitting rate limit in regular usage. Defaults to 5 seconds.

get_pnodes()#
get_stats()#
get_status(date='latest') str#

Get Current Status of the Grid. Only date=”latest” is supported

Known possible values: Normal, Restricted Maintenance Operations, Flex Alert

get_storage(date, verbose=False)#

Return storage charging or discharging for today in 5 minute intervals

Negative means charging, positive means discharging

Arguments:

date: date to return data

get_supply(date, end=None, verbose=False)#

Get supply for a date or date range in hourly intervals

class gridstatus.Ercot[source]#

Bases: gridstatus.base.ISOBase

Electric Reliability Council of Texas (ERCOT)

Attributes

BASE

https://www.ercot.com/api/1/services/read/dashboards

default_timezone

US/Central

iso_id

ercot

name

Electric Reliability Council of Texas

status_homepage

https://www.ercot.com/gridmktinfo/dashboards/gridconditions

Methods

get_fuel_mix

Get fuel mix in 5 minute intervals for a provided day

get_load

get_load_forecast

get_rtm_spp

Get Historical RTM Settlement Point Prices (SPPs) for each of the Hubs and Load Zones

get_status

Returns status of grid

get_supply

Returns most recent data point for supply in MW

get_fuel_mix(date)#

Get fuel mix in 5 minute intervals for a provided day

Arguments:

date (datetime or str): “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.

start (datetime or str): start of date range to return. alias for date parameter. Only specify one of date or start.

end (datetime or str): “today” or an object that can be parsed as a datetime for the day to return data. Only used if requesting a range of dates.

verbose (bool): print verbose output. Defaults to False.

Returns:

pd.Dataframe: dataframe with columns: Time and columns for each fuel type

get_load(date, verbose=False)#
get_load_forecast(date, verbose=False)#
get_rtm_spp(year)#

Get Historical RTM Settlement Point Prices (SPPs) for each of the Hubs and Load Zones

Arguments:

year (int): year to get data for

Source: https://www.ercot.com/mp/data-products/data-product-details?id=NP6-785-ER

get_status(date, verbose=False)#

Returns status of grid

get_supply(date, verbose=False)#

Returns most recent data point for supply in MW

Updates every 5 minutes

gridstatus.get_iso(iso_id)[source]#

Get an ISO by its id

class gridstatus.ISONE[source]#

Bases: gridstatus.base.ISOBase

ISO New England (ISONE)

Attributes

default_timezone

US/Eastern

hubs

None

interfaces

None

iso_id

isone

markets

None

name

ISO New England

status_homepage

https://www.iso-ne.com/markets-operations/system-forecast-status/current-system-status

zones

None

Methods

get_fuel_mix

Return fuel mix at a previous date

get_lmp

Find Node ID mapping: https://www.iso-ne.com/markets-operations/settlements/pricing-node-tables/

get_load

Return load at a previous date in 5 minute intervals

get_load_forecast

Return forecast at a previous date

get_status

Get latest status for ISO NE

get_supply

Get supply for a date or date range in hourly intervals

get_fuel_mix(date, end=None, verbose=False)#

Return fuel mix at a previous date

Provided at frequent, but irregular intervals by ISONE

get_lmp(date, end=None, market: str = None, locations: list = None, include_id=False, verbose=False)#

Find Node ID mapping: https://www.iso-ne.com/markets-operations/settlements/pricing-node-tables/

get_load(date)#

Return load at a previous date in 5 minute intervals

get_load_forecast(date, end=None, verbose=False)#

Return forecast at a previous date

get_status(date, verbose=False)#

Get latest status for ISO NE

get_supply(date, end=None, verbose=False)#

Get supply for a date or date range in hourly intervals

gridstatus.list_isos()[source]#

List available ISOs

class gridstatus.Markets[source]#

Bases: enum.Enum

Names of LMP Markets

Attributes

DAY_AHEAD_HOURLY

DAY_AHEAD_HOURLY

REAL_TIME_15_MIN

REAL_TIME_15_MIN

REAL_TIME_5_MIN

REAL_TIME_5_MIN

REAL_TIME_HOURLY

REAL_TIME_HOURLY

Methods

__contains__

__contains__(item)#
class gridstatus.MISO[source]#

Bases: gridstatus.base.ISOBase

Midcontinent Independent System Operator (MISO)

Attributes

BASE

https://api.misoenergy.org/MISORTWDDataBroker/DataBrokerServices.asmx

default_timezone

US/Central

hubs

[‘ILLINOIS.HUB’, ‘INDIANA.HUB’, ‘LOUISIANA.HUB’, ‘MICHIGAN.HUB’, ‘MINN.HUB’, ‘MS.HUB’, ‘TEXAS.HUB’, ‘ARKANSAS.HUB’]

iso_id

miso

markets

None

name

Midcontinent ISO

Methods

get_fuel_mix

Get fuel mix in 5 minute intervals for a provided day

get_lmp

Supported Markets:

get_load

get_load_forecast

get_supply

Get supply for a date in hourly intervals

get_fuel_mix(date, verbose=False)#

Get fuel mix in 5 minute intervals for a provided day

Arguments:

date (datetime or str): “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.

start (datetime or str): start of date range to return. alias for date parameter. Only specify one of date or start.

end (datetime or str): “today” or an object that can be parsed as a datetime for the day to return data. Only used if requesting a range of dates.

verbose (bool): print verbose output. Defaults to False.

Returns:

pd.Dataframe: dataframe with columns: Time and columns for each fuel type

get_lmp(date, market: str, locations: list = None)#

Supported Markets:

REAL_TIME_5_MIN (FiveMinLMP) DAY_AHEAD_HOURLY (DayAheadExPostLMP)

get_load(date, verbose=False)#
get_load_forecast(date, verbose=False)#
get_supply(date, end=None, verbose=False)#

Get supply for a date in hourly intervals

class gridstatus.NYISO[source]#

Bases: gridstatus.base.ISOBase

New York Independent System Operator (NYISO)

Attributes

default_timezone

US/Eastern

iso_id

nyiso

markets

None

name

New York ISO

status_homepage

https://www.nyiso.com/system-conditions

Methods

get_fuel_mix

Get fuel mix in 5 minute intervals for a provided day

get_lmp

Supported Markets: REAL_TIME_5_MIN, DAY_AHEAD_HOURLY

get_load

Returns load at a previous date in 5 minute intervals

get_load_forecast

Get load forecast for a date in 1 hour intervals

get_status

get_supply

Get supply for a date or date range in hourly intervals

get_fuel_mix(date, end=None, verbose=False)#

Get fuel mix in 5 minute intervals for a provided day

Arguments:

date (datetime or str): “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.

start (datetime or str): start of date range to return. alias for date parameter. Only specify one of date or start.

end (datetime or str): “today” or an object that can be parsed as a datetime for the day to return data. Only used if requesting a range of dates.

verbose (bool): print verbose output. Defaults to False.

Returns:

pd.Dataframe: dataframe with columns: Time and columns for each fuel type

get_lmp(date, end=None, market: str = None, locations: list = None, location_type: str = None)#

Supported Markets: REAL_TIME_5_MIN, DAY_AHEAD_HOURLY

Supported Location Types: “zone”, “generator”

get_load(date, end=None, verbose=False)#

Returns load at a previous date in 5 minute intervals

get_load_forecast(date, end=None, verbose=False)#

Get load forecast for a date in 1 hour intervals

get_status(date, end=None, verbose=False)#
get_supply(date, end=None, verbose=False)#

Get supply for a date or date range in hourly intervals

class gridstatus.PJM[source]#

Bases: gridstatus.base.ISOBase

PJM

Attributes

default_timezone

US/Eastern

hub_node_ids

[‘51217’, ‘116013751’, ‘35010337’, ‘34497151’, ‘34497127’, ‘34497125’, ‘33092315’, ‘33092313’, ‘33092311’, ‘4669664’, ‘51288’, ‘51287’]

iso_id

pjm

location_types

[‘ZONE’, ‘LOAD’, ‘GEN’, ‘AGGREGATE’, ‘INTERFACE’, ‘EXT’, ‘HUB’, ‘EHV’, ‘TIE’, ‘RESIDUAL_METERED_EDC’]

markets

None

name

PJM

Methods

get_fuel_mix

Get fuel mix for a date or date range in hourly intervals

get_lmp

Returns LMP at a previous date

get_load

Returns load at a previous date at 5 minute intervals

get_load_forecast

Get forecast for today in hourly intervals.

get_pnode_ids

get_supply

Get supply for a date or date range in hourly intervals

get_fuel_mix(date, end=None, verbose=False)#

Get fuel mix for a date or date range in hourly intervals

get_lmp(date, market: str, end=None, locations='hubs', location_type=None, verbose=False)#

Returns LMP at a previous date

Notes:
  • If start date is prior to the PJM archive date, all data must be downloaded before location filtering can be performed due to limitations of PJM API. The archive date is 186 days (~6 months) before today for the 5 minute real time market and 731 days (~2 years) before today for the Hourly Real Time and Day Ahead Hourly markets. Node type filter can performed for Real Time Hourly and Day Ahead Hourly markets.

  • If location_type is provided, it is filtered after data is retrieved for Real Time 5 Minute market regardless of the date. This is due to PJM api limitations

Args:

date (str or datetime.date): date to get LMPs for

end (str or datetime.date): end date to get LMPs for

market (str): Supported Markets: REAL_TIME_5_MIN, REAL_TIME_HOURLY, DAY_AHEAD_HOURLY

locations (list, optional): list of pnodeid to get LMPs for. Defaults to “hubs”. Use get_pnode_ids() to get a list of possible pnode ids. If “all”, will return data from all p nodes (warning there are over 10,000 unique pnodes, so expect millions or billions of rows!)

location_type (str, optional): If specified, will only return data for nodes of this type. Defaults to None. Possible location types are: ‘ZONE’, ‘LOAD’, ‘GEN’, ‘AGGREGATE’, ‘INTERFACE’, ‘EXT’,

‘HUB’, ‘EHV’, ‘TIE’, ‘RESIDUAL_METERED_EDC’.

get_load(date, end=None)#

Returns load at a previous date at 5 minute intervals

Args:

date (str or datetime.date): date to get load for. must be in last 30 days

get_load_forecast(date)#

Get forecast for today in hourly intervals.

Updates every Every half hour on the quarter E.g. 1:15 and 1:45

get_pnode_ids()#
get_supply(date, end=None, verbose=False)#

Get supply for a date or date range in hourly intervals

class gridstatus.SPP[source]#

Bases: gridstatus.base.ISOBase

Southwest Power Pool (SPP)

Attributes

default_timezone

US/Central

iso_id

spp

name

Southwest Power Pool

status_homepage

https://www.spp.org/markets-operations/current-grid-conditions/

Methods

get_fuel_mix

Get fuel mix in 5 minute intervals for a provided day

get_load

Returns load for last 24hrs in 5 minute intervals

get_load_forecast

type (str): MID_TERM is hourly for next 7 days or SHORT_TERM is every five minutes for a few hours

get_status

get_supply

Get supply for a date in hourly intervals

get_fuel_mix(date, verbose=False)#

Get fuel mix in 5 minute intervals for a provided day

Arguments:

date (datetime or str): “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.

start (datetime or str): start of date range to return. alias for date parameter. Only specify one of date or start.

end (datetime or str): “today” or an object that can be parsed as a datetime for the day to return data. Only used if requesting a range of dates.

verbose (bool): print verbose output. Defaults to False.

Returns:

pd.Dataframe: dataframe with columns: Time and columns for each fuel type

get_load(date, verbose=False)#

Returns load for last 24hrs in 5 minute intervals

get_load_forecast(date, forecast_type='MID_TERM', verbose=False)#

type (str): MID_TERM is hourly for next 7 days or SHORT_TERM is every five minutes for a few hours

get_status(date=None, verbose=False)#
get_supply(date, end=None, verbose=False)#

Get supply for a date in hourly intervals