Gridstatus
Contents
Gridstatus#
Subpackages#
Submodules#
Package Contents#
Classes Summary#
California Independent System Operator (CAISO) |
|
Electric Reliability Council of Texas (ERCOT) |
|
ISO New England (ISONE) |
|
Names of LMP Markets |
|
Midcontinent Independent System Operator (MISO) |
|
New York Independent System Operator (NYISO) |
|
PJM |
|
Southwest Power Pool (SPP) |
Exceptions Summary#
Functions#
Get an ISO by its id |
|
List available ISOs |
|
Load a single DataFrame for same schema csv files in a folder |
Contents#
- class gridstatus.CAISO[source]#
Bases:
gridstatus.base.ISOBaseCalifornia Independent System Operator (CAISO)
Attributes
default_timezone
US/Pacific
interconnection_homepage
iso_id
caiso
markets
None
name
California ISO
status_homepage
trading_hub_locations
[‘TH_NP15_GEN-APND’, ‘TH_SP15_GEN-APND’, ‘TH_ZP26_GEN-APND’]
Methods
Return AS prices for a given date for each region
Get ancillary services procurement data from CAISO.
Return curtailed non-operational generator report for a given date.
Return curtailment data for a given date
Get fuel mix in 5 minute intervals for a provided day
Return gas prices at a previous date
Return ghg allowance at a previous date
Get LMP pricing starting at supplied date for a list of locations.
Return load at a previous date in 5 minute intervals
Returns load forecast for a previous date in 1 hour intervals
Return data from OASIS for a given dataset
Get Current Status of the Grid. Only date="latest" is supported
Return storage charging or discharging for today in 5 minute intervals
- get_as_prices(date, end=None, market='DAM', sleep=4, verbose=False)#
Return AS prices for a given date for each region
- Parameters
date (datetime.date, str) – date to return data
end (datetime.date, str) – last date of range to return data. If None, returns only date. Defaults to None.
market (str) – DAM or HASP. Defaults to DAM.
verbose (bool, optional) – print out url being fetched. Defaults to False.
- Returns
A DataFrame of AS prices
- Return type
pandas.DataFrame
- get_as_procurement(date, end=None, market='DAM', sleep=4, verbose=False)#
Get ancillary services procurement data from CAISO.
- Parameters
date (datetime.date, str) – date to return data
end (datetime.date, str) – last date of range to return data. If None, returns only date. Defaults to None.
market – DAM or RTM. Defaults to DAM.
- Returns
A DataFrame of ancillary services data
- Return type
pandas.DataFrame
- get_curtailed_non_operational_generator_report(date, end=None, verbose=False)#
- Return curtailed non-operational generator report for a given date.
Earliest available date is June 17, 2021.
- Parameters
date (datetime.date, str) – date to return data
end (datetime.date, str) – last date of range to return data. If None, returns only date. Defaults to None.
verbose (bool, optional) – print out url being fetched. Defaults to False.
- Returns
A DataFrame of curtailed non-operational generator report
column glossary: http://www.caiso.com/market/Pages/OutageManagement/Curtailed-OperationalGeneratorReportGlossary.aspx
if requesting multiple days, may want to run following to remove outages that get reported across multiple days: ```df.drop_duplicates(
subset=[“OUTAGE MRID”, “CURTAILMENT START DATE TIME”], keep=”last”)```
- Return type
pandas.DataFrame
- get_curtailment(date, verbose=False)#
Return curtailment data for a given date
Notes
requires java to be installed in order to run
Data available from June 30, 2016 to present
- Parameters
date (datetime.date, str) – date to return data
end (datetime.date, str) – last date of range to return data. If None, returns only date. Defaults to None.
verbose – print out url being fetched. Defaults to False.
- Returns
A DataFrame of curtailment data
- Return type
pandas.DataFrame
- get_fuel_mix(date, start=None, end=None, verbose=False)#
Get fuel mix in 5 minute intervals for a provided day
- Parameters
date (datetime.date, str) – “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.
start (datetime.date, str) – start of date range to return. alias for date parameter. Only specify one of date or start.
end (datetime.date, 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, optional) – print verbose output. Defaults to False.
- Returns
A DataFrame with columns - ‘Time’ and columns for each fuel type.
- Return type
pandas.DataFrame
- get_gas_prices(date, end=None, fuel_region_id='ALL', sleep=4, verbose=False)#
Return gas prices at a previous date
- Parameters
date (datetime.date, str) – date to return data
end (datetime.date, str) – 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.
- Returns
A DataFrame of gas prices
- Return type
pandas.DataFrame
- get_ghg_allowance(date, end=None, sleep=4, verbose=False)#
Return ghg allowance at a previous date
- Parameters
date (datetime.date, str) – date to return data
end (datetime.date, str) – last date of range to return data. If None, returns only date. Defaults to None.
- get_interconnection_queue(verbose=False)#
- get_lmp(date, market: str, locations: list = None, sleep: int = 5, end=None, verbose=False)#
Get LMP pricing starting at supplied date for a list of locations.
- Parameters
date (datetime.date, str) – 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. USE “ALL_AP_NODES” for all Aggregate Pricing Node. Use “ALL” to get all nodes. 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
A DataFrame of pricing data
- Return type
pandas.DataFrame
- get_load(date, end=None, verbose=False)#
Return load at a previous date in 5 minute intervals
- get_load_forecast(date, end=None, sleep=4, verbose=False)#
Returns load forecast for a previous date in 1 hour intervals
- Parameters
date (datetime.date, pd.Timestamp, 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_oasis_dataset(dataset, date, end=None, params=None, raw_data=True, sleep=5, verbose=False)#
Return data from OASIS for a given dataset
- Parameters
dataset (str) – dataset to return data for. See CAISO.list_oasis_datasets for supported datasets
date (datetime.date, str) – date to return data
end (datetime.date, str) – last date of range to return data. If None, returns only date. Defaults to None.
params (dict) – dictionary of parameters to pass to dataset. See CAISO.list_oasis_datasets for supported parameters
raw_data (bool, optional) – return raw data from OASIS. Defaults to True.
sleep (int, optional) – number of seconds to sleep between requests. Defaults to 5.
verbose (bool, optional) – print out url being fetched. Defaults to False.
- Returns
A DataFrame of OASIS data
- Return type
pandas.DataFrame
- get_pnodes(verbose=False)#
- get_stats(verbose=False)#
- get_status(date='latest', verbose=False) 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
- Parameters
date (datetime.date, str) – date to return data
- list_oasis_datasets(dataset=None)#
- class gridstatus.Ercot[source]#
Bases:
gridstatus.base.ISOBaseElectric Reliability Council of Texas (ERCOT)
- class Document#
Attributes
constructed_name
None
friendly_name
None
publish_date
None
url
None
Attributes
ACTUAL_LOADS_URL_FORMAT
https://www.ercot.com/content/cdr/html/{timestamp}_actual_loads_of_forecast_zones.html
AS_PRICES_HISTORICAL_MAX_DAYS
30
BASE
default_timezone
US/Central
interconnection_homepage
http://mis.ercot.com/misapp/GetReports.do?reportTypeId=15933
iso_id
ercot
LOAD_HISTORICAL_MAX_DAYS
14
location_types
None
markets
None
name
Electric Reliability Council of Texas
status_homepage
Methods
Get ancillary service clearing prices in hourly intervals in Day Ahead Market
Get Historical DAM Settlement Point Prices(SPPs)
Get fuel mix 5 minute intervals
Get interconnection queue for ERCOT
Get load for a date
Returns load forecast
Get Historical RTM Settlement Point Prices(SPPs)
Get SPP data for ERCOT
Returns status of grid
- get_as_prices(date, end=None, verbose=False)#
Get ancillary service clearing prices in hourly intervals in Day Ahead Market
- Parameters
date (datetime.date, str) – date of delivery for AS services
end (datetime.date, str, optional) – if declared, function will return data as a range, from “date” to “end”
verbose (bool, optional) – print verbose output. Defaults to False.
- Returns
A DataFrame with prices for “Non-Spinning Reserves”, “Regulation Up”, “Regulation Down”, “Responsive Reserves”.
- Return type
pandas.DataFrame
- get_dam_spp(year, verbose=False)#
Get Historical DAM Settlement Point Prices(SPPs) for each of the Hubs and Load Zones
- Parameters
year (int) – year to get data for. Starting 2011, returns data for the entire year
- get_fuel_mix(date, verbose=False)#
Get fuel mix 5 minute intervals
- Parameters
date (datetime.date, str) – “latest”, “today”, and yesterday’s date are supported.
verbose (bool) – print verbose output. Defaults to False.
- Returns
A DataFrame with columns; Time and columns for each fuel type
- Return type
pandas.DataFrame
- get_interconnection_queue(verbose=False)#
Get interconnection queue for ERCOT
- Monthly historical data available here:
- get_load(date, end=None, verbose=False)#
Get load for a date
- get_load_forecast(date, verbose=False)#
Returns load forecast
Currently only supports today’s forecast
- get_rtm_spp(year, verbose=False)#
- Get Historical RTM Settlement Point Prices(SPPs)
for each of the Hubs and Load Zones
- Parameters
year (int) – year to get data for Starting 2011, returns data for the entire year
- get_spp(date, end=None, market: str = None, locations: list = 'ALL', location_type: str = 'ALL', verbose=False)#
Get SPP data for ERCOT
- Supported Markets:
REAL_TIME_15_MINDAY_AHEAD_HOURLY
- Supported Location Types:
zonehubnode
- get_status(date, verbose=False)#
Returns status of grid
- parse_doc(doc, verbose=False)#
- read_doc(doc, verbose=False)#
- class gridstatus.ISONE[source]#
Bases:
gridstatus.base.ISOBaseISO New England (ISONE)
Attributes
default_timezone
US/Eastern
hubs
None
interconnection_homepage
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
Return BTM solar at a previous date in 5 minute intervals
Return fuel mix at a previous date
Get the interconnection queue. Contains active and withdrawm applications.
Find Node ID mapping:
Return load at a previous date in 5 minute intervals
Return forecast at a previous date
Get latest status for ISO NE
- get_btm_solar(date, end=None, verbose=False)#
Return BTM solar at a previous date in 5 minute 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_interconnection_queue(verbose=False)#
Get the interconnection queue. Contains active and withdrawm applications.
More information: https://www.iso-ne.com/system-planning/interconnection-service/interconnection-request-queue/
- Returns
interconnection queue
- Return type
pandas.DataFrame
- 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, end=None, verbose=False)#
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
- gridstatus.load_folder(path, time_zone=None, verbose=True)[source]#
Load a single DataFrame for same schema csv files in a folder
- Parameters
path (str) – path to folder
time_zone (str) – time zone to localize to timestamps. By default returns as UTC
verbose (bool, optional) – print verbose output. Defaults to True.
- Returns
A DataFrame of all files
- Return type
pandas.DataFrame
- class gridstatus.Markets[source]#
Bases:
enum.EnumNames 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__(item)#
- class gridstatus.MISO[source]#
Bases:
gridstatus.base.ISOBaseMidcontinent Independent System Operator (MISO)
Attributes
BASE
https://api.misoenergy.org/MISORTWDDataBroker/DataBrokerServices.asmx
default_timezone
US/Eastern
hubs
[‘ILLINOIS.HUB’, ‘INDIANA.HUB’, ‘LOUISIANA.HUB’, ‘MICHIGAN.HUB’, ‘MINN.HUB’, ‘MS.HUB’, ‘TEXAS.HUB’, ‘ARKANSAS.HUB’]
interconnection_homepage
https://www.misoenergy.org/planning/generator-interconnection/GI_Queue/
iso_id
miso
markets
None
name
Midcontinent ISO
Methods
Get the fuel mix for a given day for a provided MISO.
Get the interconnection queue
Supported Markets:
- get_fuel_mix(date, verbose=False)#
Get the fuel mix for a given day for a provided MISO.
- Parameters
date (datetime.date, str) – “latest”, “today”, or an object that can be parsed as a datetime for the day to return data.
verbose (bool, optional) – print verbose output. Defaults to False.
- Returns
DataFrame with columns “Time”, “Load”, “Fuel Mix”
- Return type
pandas.DataFrame
- get_interconnection_queue(verbose=False)#
Get the interconnection queue
- Returns
Interconnection queue
- Return type
pandas.DataFrame
- get_lmp(date, market: str, locations: list = None, verbose=False)#
- Supported Markets:
REAL_TIME_5_MIN- (FiveMinLMP)DAY_AHEAD_HOURLY- (DayAheadExPostLMP)
- get_load(date, verbose=False)#
- get_load_forecast(date, verbose=False)#
- exception gridstatus.NotSupported[source]#
Bases:
ExceptionCommon base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class gridstatus.NYISO[source]#
Bases:
gridstatus.base.ISOBaseNew York Independent System Operator (NYISO)
Attributes
default_timezone
US/Eastern
interconnection_homepage
iso_id
nyiso
markets
None
name
New York ISO
status_homepage
Methods
Pull the most recent capacity market report's market clearing prices
Get a list of generators in NYISO
Return NYISO interconnection queue
Supported Markets:
Returns load at a previous date in 5 minute intervals for
Get load forecast for a date in 1 hour intervals
Get a list of loads in NYISO
- get_capacity_prices(date=None, verbose=False)#
Pull the most recent capacity market report’s market clearing prices
- Parameters
date (pandas.Timestamp) – date that will be used to pull latest capacity report (will refer to month and year)
verbose (bool, optional) – print out requested url. Defaults to False.
- Returns
a DataFrame of monthly capacity prices (all three auctions) for each of the four capacity localities within NYISO
- get_fuel_mix(date, end=None, verbose=False)#
- get_generators(verbose=False)#
Get a list of generators in NYISO
When possible return capacity and fuel type information
- Parameters
verbose (bool, optional) – print out requested url. Defaults to False.
- Returns
a DataFrame of generators and locations
Possible Columns
Generator Name
PTID
Subzone
Zone
Latitude
Longitude
Owner, Operator, and / or Billing Organization
Station Unit
Town
County
State
In-Service Date
Name Plate Rating (V) MW
2022 CRIS MW Summer
2022 CRIS MW Winter
2022 Capability MW Summer
2022 Capability MW Winter
Is Dual Fuel
Unit Type
Fuel Type 1
Fuel Type 2
2021 Net Energy GWh
Notes
Generator Type
- Return type
pandas.DataFrame
- get_interconnection_queue(verbose=False)#
Return NYISO interconnection queue
Additional Non-NYISO queue info: https://www3.dps.ny.gov/W/PSCWeb.nsf/All/286D2C179E9A5A8385257FBF003F1F7E?OpenDocument
- Returns
Interconnection queue containing, active, withdrawn, and completed project
- Return type
pandas.DataFrame
- get_lmp(date, end=None, market: str = None, locations: list = None, location_type: str = None, verbose=False)#
- Supported Markets:
REAL_TIME_5_MINDAY_AHEAD_HOURLY
- Supported Location Types:
zonegenerator
- get_load(date, end=None, verbose=False)#
- Returns load at a previous date in 5 minute intervals for
each zone and total load
- Parameters
date (str) – Date to get load for. Can be “latest”, “today”, or a date in the format YYYY-MM-DD
end (str) – End date for date range. Optional.
verbose (bool) – Whether to print verbose output. Optional.
- Returns
Load data for NYISO and each zone
- Return type
pandas.DataFrame
- get_load_forecast(date, end=None, verbose=False)#
Get load forecast for a date in 1 hour intervals
- get_loads(verbose=False)#
Get a list of loads in NYISO
- Parameters
verbose (bool, optional) – print out requested url. Defaults to False.
- Returns
a DataFrame of loads and locations
- Return type
pandas.DataFrame
- get_status(date, end=None, verbose=False)#
- class gridstatus.PJM[source]#
Bases:
gridstatus.base.ISOBasePJM
Attributes
default_timezone
US/Eastern
hub_node_ids
[‘51217’, ‘116013751’, ‘35010337’, ‘34497151’, ‘34497127’, ‘34497125’, ‘33092315’, ‘33092313’, ‘33092311’, ‘4669664’, ‘51288’, ‘51287’]
interconnection_homepage
https://www.pjm.com/planning/services-requests/interconnection-queues.aspx
iso_id
pjm
location_types
[‘ZONE’, ‘LOAD’, ‘GEN’, ‘AGGREGATE’, ‘INTERFACE’, ‘EXT’, ‘HUB’, ‘EHV’, ‘TIE’, ‘RESIDUAL_METERED_EDC’]
markets
None
name
PJM
zone_node_ids
[‘1’, ‘3’, ‘51291’, ‘51292’, ‘51293’, ‘51295’, ‘51296’, ‘51297’, ‘51298’, ‘51299’, ‘51300’, ‘51301’, ‘7633629’, ‘8394954’, ‘8445784’, ‘33092371’, ‘34508503’, ‘34964545’, ‘37737283’, ‘116013753’, ‘124076095’, ‘970242670’, ‘1709725933’]
Methods
Get fuel mix for a date or date range in hourly intervals
Returns LMP at a previous date
Returns load at a previous date at 5 minute intervals
Get forecast for today in hourly intervals.
- get_fuel_mix(date, end=None, verbose=False)#
Get fuel mix for a date or date range in hourly intervals
- get_interconnection_queue(verbose=False)#
- 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 be 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
- Parameters
date (datetime.date, str) – date to get LMPs for
end (datetime.date, str) – 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, verbose=False)#
Returns load at a previous date at 5 minute intervals
- Parameters
date (datetime.date, str) – date to get load for. must be in last 30 days
- Returns
Load data time series. Columns: Time, Load, and all areas
Load columns represent PJM-wide load
Returns data for the following areas: AE, AEP, APS, ATSI,
BC, COMED, DAYTON, DEOK, DOM, DPL, DUQ, EKPC, JC, ME, PE, PEP, PJM MID ATLANTIC REGION, PJM RTO, PJM SOUTHERN REGION, PJM WESTERN REGION, PL, PN, PS, RECO
- Return type
pd.DataFrame
- get_load_forecast(date, verbose=False)#
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()#
- class gridstatus.SPP[source]#
Bases:
gridstatus.base.ISOBaseSouthwest Power Pool (SPP)
Attributes
default_timezone
US/Central
interconnection_homepage
iso_id
spp
location_types
None
markets
None
name
Southwest Power Pool
status_homepage
https://www.spp.org/markets-operations/current-grid-conditions/
Methods
Get fuel mix
Get interconnection queue
Get LMP data
Returns load for last 24hrs in 5 minute intervals
Returns load forecast for next 7 days in hourly intervals
Get VER Curtailments
Get VER Curtailments for a year. Starting 2014.
- get_fuel_mix(date, detailed=False, verbose=False)#
Get fuel mix
- Parameters
date – supports today and latest
detailed – if True, breaks out self scheduled and market scheduled
Note
if today, returns last 2 hours of data. maybe include previous day
- Returns
fuel mix
- Return type
pd.DataFrame
- get_interconnection_queue(verbose=False)#
Get interconnection queue
- Returns
Interconnection queue
- Return type
pandas.DataFrame
- get_lmp(date, end=None, market: str = None, locations: list = 'ALL', location_type: str = LOCATION_TYPE_HUB, verbose=False)#
Get LMP data
- Supported Markets:
REAL_TIME_5_MINDAY_AHEAD_HOURLY
- Supported Location Types:
hubinterfacesettlement_location
- get_load(date, verbose=False)#
Returns load for last 24hrs in 5 minute intervals
- get_load_forecast(date, forecast_type='MID_TERM', verbose=False)#
Returns load forecast for next 7 days in hourly intervals
- Parameters
forecast_type (str) – MID_TERM is hourly for next 7 days or SHORT_TERM is every five minutes for a few hours
- Returns
forecast for current day
- Return type
pd.DataFrame
- get_status(date=None, verbose=False)#
- get_ver_curtailments(date, end=None, verbose=False)#
Get VER Curtailments
Supports recent data. For historical annual data use get_ver_curtailments_annual
- Parameters
date – start date
end – end date
- get_ver_curtailments_annual(year, verbose=True)#
Get VER Curtailments for a year. Starting 2014. Recent data use get_ver_curtailments
- Parameters
year – year to get data for
verbose – print url
- Returns
VER Curtailments
- Return type
pd.DataFrame