Gridstatus ==================== .. py:module:: gridstatus Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 3 tests/index.rst Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 base/index.rst caiso/index.rst decorators/index.rst ercot/index.rst isone/index.rst lmp_config/index.rst logging/index.rst miso/index.rst nyiso/index.rst pjm/index.rst spp/index.rst test/index.rst utils/index.rst version/index.rst viz/index.rst Package Contents ---------------- Classes Summary ~~~~~~~~~~~~~~~ .. autoapisummary:: gridstatus.CAISO gridstatus.Ercot gridstatus.ISONE gridstatus.Markets gridstatus.MISO gridstatus.NYISO gridstatus.PJM gridstatus.SPP Exceptions Summary ~~~~~~~~~~~~~~~~~~ .. autoapisummary:: `gridstatus.NotSupported` Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: gridstatus.get_iso gridstatus.list_isos gridstatus.load_folder Contents ~~~~~~~~~~~~~~~~~~~ .. py:class:: CAISO Bases: :py:obj:`gridstatus.base.ISOBase` California Independent System Operator (CAISO) **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **default_timezone** - US/Pacific * - **interconnection_homepage** - https://rimspub.caiso.com/rimsui/logon.do * - **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** .. autoapisummary:: :nosignatures: gridstatus.CAISO.get_as_prices gridstatus.CAISO.get_as_procurement gridstatus.CAISO.get_curtailment gridstatus.CAISO.get_fuel_mix gridstatus.CAISO.get_gas_prices gridstatus.CAISO.get_ghg_allowance gridstatus.CAISO.get_interconnection_queue gridstatus.CAISO.get_lmp gridstatus.CAISO.get_load gridstatus.CAISO.get_load_forecast gridstatus.CAISO.get_pnodes gridstatus.CAISO.get_stats gridstatus.CAISO.get_status gridstatus.CAISO.get_storage .. py:method:: get_as_prices(date, end=None, sleep=4, verbose=False) Return AS prices for a given date for each region :param date: date to return data :type date: datetime.date, str :param end: last date of range to return data. If None, returns only date. Defaults to None. :type end: datetime.date, str :param verbose: print out url being fetched. Defaults to False. :type verbose: bool, optional :returns: A DataFrame of AS prices :rtype: pandas.DataFrame .. py:method:: get_as_procurement(date, end=None, market='DAM', sleep=4, verbose=False) Get ancillary services procurement data from CAISO. :param date: date to return data :type date: datetime.date, str :param end: last date of range to return data. If None, returns only date. Defaults to None. :type end: datetime.date, str :param market: DAM or RTM. Defaults to DAM. :returns: A DataFrame of ancillary services data :rtype: pandas.DataFrame .. py:method:: get_curtailment(date, verbose=False) Return curtailment data for a given date .. rubric:: Notes * requires java to be installed in order to run * Data available from June 30, 2016 to present :param date: date to return data :type date: datetime.date, str :param end: last date of range to return data. If None, returns only date. Defaults to None. :type end: datetime.date, str :param verbose: print out url being fetched. Defaults to False. :returns: A DataFrame of curtailment data :rtype: pandas.DataFrame .. py:method:: get_fuel_mix(date, start=None, end=None, verbose=False) Get fuel mix in 5 minute intervals for a provided day :param date: "latest", "today", or an object that can be parsed as a datetime for the day to return data. :type date: datetime.date, str :param start: start of date range to return. alias for `date` parameter. Only specify one of `date` or `start`. :type start: datetime.date, str :param end: "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. :type end: datetime.date, str :param verbose: print verbose output. Defaults to False. :type verbose: bool, optional :returns: A DataFrame with columns - 'Time' and columns for each fuel type. :rtype: pandas.DataFrame .. py:method:: get_gas_prices(date, end=None, fuel_region_id='ALL', sleep=4, verbose=False) Return gas prices at a previous date :param date: date to return data :type date: datetime.date, str :param end: last date of range to return data. If None, returns only date. Defaults to None. :type end: datetime.date, str :param fuel_region_id: single fuel region id or list of fuel region ids to return data for. Defaults to ALL, which returns all fuel regions. :type fuel_region_id: str, or list :returns: A DataFrame of gas prices :rtype: pandas.DataFrame .. py:method:: get_ghg_allowance(date, end=None, sleep=4, verbose=False) Return ghg allowance at a previous date :param date: date to return data :type date: datetime.date, str :param end: last date of range to return data. If None, returns only date. Defaults to None. :type end: datetime.date, str .. py:method:: get_interconnection_queue(verbose=False) .. py:method:: 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. :param date: date to return data :type date: datetime.date, str :param market: market to return from. supports: :param locations: 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()`` :type locations: list :param sleep: number of seconds to sleep before returning to avoid hitting rate limit in regular usage. Defaults to 5 seconds. :type sleep: int :returns: A DataFrame of pricing data :rtype: pandas.DataFrame .. py:method:: get_load(date, end=None, verbose=False) Return load at a previous date in 5 minute intervals .. py:method:: get_load_forecast(date, end=None, sleep=4, verbose=False) Returns load forecast for a previous date in 1 hour intervals :param date: day to return. If string, format should be YYYYMMDD e.g 20200623 :type date: datetime.date, pd.Timestamp, str :param sleep: number of seconds to sleep before returning to avoid hitting rate limit in regular usage. Defaults to 5 seconds. :type sleep: int .. py:method:: get_pnodes() .. py:method:: get_stats(verbose=False) .. py:method:: 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 .. py:method:: get_storage(date, verbose=False) Return storage charging or discharging for today in 5 minute intervals Negative means charging, positive means discharging :param date: date to return data :type date: datetime.date, str .. py:class:: Ercot Bases: :py:obj:`gridstatus.base.ISOBase` Electric Reliability Council of Texas (ERCOT) .. py:class:: Document **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **publish_date** - None * - **url** - None **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **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** - https://www.ercot.com/api/1/services/read/dashboards * - **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** - https://www.ercot.com/gridmktinfo/dashboards/gridconditions **Methods** .. autoapisummary:: :nosignatures: gridstatus.Ercot.get_as_prices gridstatus.Ercot.get_fuel_mix gridstatus.Ercot.get_interconnection_queue gridstatus.Ercot.get_load gridstatus.Ercot.get_load_forecast gridstatus.Ercot.get_rtm_spp gridstatus.Ercot.get_spp gridstatus.Ercot.get_status gridstatus.Ercot.read_doc .. py:method:: get_as_prices(date, end=None, verbose=False) Get ancillary service clearing prices in hourly intervals in Day Ahead Market :param date: date of delivery for AS services :type date: datetime.date, str :param end: if declared, function will return data as a range, from "date" to "end" :type end: datetime.date, str, optional :param verbose: print verbose output. Defaults to False. :type verbose: bool, optional :returns: A DataFrame with prices for "Non-Spinning Reserves", "Regulation Up", "Regulation Down", "Responsive Reserves". :rtype: pandas.DataFrame Source: https://www.ercot.com/mp/data-products/data-product-details?id=NP4-181-ER .. py:method:: get_fuel_mix(date, verbose=False) Get fuel mix 5 minute intervals :param date: "latest", "today". historical data currently not supported :type date: datetime.date, str :param verbose: print verbose output. Defaults to False. :type verbose: bool :returns: A DataFrame with columns; Time and columns for each fuel type (solar and wind) :rtype: pandas.DataFrame .. py:method:: get_interconnection_queue(verbose=False) Get interconnection queue for ERCOT Monthly historical data available here: http://mis.ercot.com/misapp/GetReports.do?reportTypeId=15933&reportTitle=GIS%20Report&showHTMLView=&mimicKey .. py:method:: get_load(date, verbose=False) .. py:method:: get_load_forecast(date, verbose=False) Returns load forecast Currently only supports today's forecast .. py:method:: get_rtm_spp(year) Get Historical RTM Settlement Point Prices(SPPs) for each of the Hubs and Load Zones :param year: year to get data for :type year: int Source: https://www.ercot.com/mp/data-products/data-product-details?id=NP6-785-ER .. py:method:: get_spp(date, end=None, market: str = None, locations: list = 'ALL', location_type: str = LOCATION_TYPE_ZONE, verbose=False) Get SPP data for ERCOT Supported Markets: - ``REAL_TIME_15_MIN`` - ``DAY_AHEAD_HOURLY`` Supported Location Types: - ``zone`` - ``hub`` - ``node`` .. py:method:: get_status(date, verbose=False) Returns status of grid .. py:method:: read_doc(doc, verbose=False) .. py:function:: get_iso(iso_id) Get an ISO by its id .. py:class:: ISONE Bases: :py:obj:`gridstatus.base.ISOBase` ISO New England (ISONE) **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **default_timezone** - US/Eastern * - **hubs** - None * - **interconnection_homepage** - https://irtt.iso-ne.com/reports/external * - **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** .. autoapisummary:: :nosignatures: gridstatus.ISONE.get_fuel_mix gridstatus.ISONE.get_interconnection_queue gridstatus.ISONE.get_lmp gridstatus.ISONE.get_load gridstatus.ISONE.get_load_forecast gridstatus.ISONE.get_status .. py:method:: get_fuel_mix(date, end=None, verbose=False) Return fuel mix at a previous date Provided at frequent, but irregular intervals by ISONE .. py:method:: 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 :rtype: pandas.DataFrame .. py:method:: 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/ .. py:method:: get_load(date, verbose=False) Return load at a previous date in 5 minute intervals .. py:method:: get_load_forecast(date, end=None, verbose=False) Return forecast at a previous date .. py:method:: get_status(date, verbose=False) Get latest status for ISO NE .. py:function:: list_isos() List available ISOs .. py:function:: load_folder(path, time_zone=None, verbose=True) Load a single DataFrame for same schema csv files in a folder :param path: path to folder :type path: str :param time_zone: time zone to localize to timestamps. By default returns as UTC :type time_zone: str :param verbose: print verbose output. Defaults to True. :type verbose: bool, optional :returns: A DataFrame of all files :rtype: pandas.DataFrame .. py:class:: Markets Bases: :py:obj:`enum.Enum` Names of LMP Markets **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **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** .. autoapisummary:: :nosignatures: gridstatus.Markets.__contains__ .. py:method:: __contains__(item) .. py:class:: MISO Bases: :py:obj:`gridstatus.base.ISOBase` Midcontinent Independent System Operator (MISO) **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **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** .. autoapisummary:: :nosignatures: gridstatus.MISO.get_fuel_mix gridstatus.MISO.get_interconnection_queue gridstatus.MISO.get_lmp gridstatus.MISO.get_load gridstatus.MISO.get_load_forecast .. py:method:: get_fuel_mix(date, verbose=False) Get the fuel mix for a given day for a provided MISO. :param date: "latest", "today", or an object that can be parsed as a datetime for the day to return data. :type date: datetime.date, str :param verbose: print verbose output. Defaults to False. :type verbose: bool, optional :returns: DataFrame with columns "Time", "Load", "Fuel Mix" :rtype: pandas.DataFrame .. py:method:: get_interconnection_queue(verbose=False) Get the interconnection queue :returns: Interconnection queue :rtype: pandas.DataFrame .. py:method:: get_lmp(date, market: str, locations: list = None, verbose=False) Supported Markets: - ``REAL_TIME_5_MIN`` - (FiveMinLMP) - ``DAY_AHEAD_HOURLY`` - (DayAheadExPostLMP) .. py:method:: get_load(date, verbose=False) .. py:method:: get_load_forecast(date, verbose=False) .. py:exception:: NotSupported Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. Initialize self. See help(type(self)) for accurate signature. .. py:class:: NYISO Bases: :py:obj:`gridstatus.base.ISOBase` New York Independent System Operator (NYISO) **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **default_timezone** - US/Eastern * - **interconnection_homepage** - https://www.nyiso.com/interconnections * - **iso_id** - nyiso * - **markets** - None * - **name** - New York ISO * - **status_homepage** - https://www.nyiso.com/system-conditions **Methods** .. autoapisummary:: :nosignatures: gridstatus.NYISO.get_capacity_prices gridstatus.NYISO.get_fuel_mix gridstatus.NYISO.get_generators gridstatus.NYISO.get_interconnection_queue gridstatus.NYISO.get_lmp gridstatus.NYISO.get_load gridstatus.NYISO.get_load_forecast gridstatus.NYISO.get_loads gridstatus.NYISO.get_status .. py:method:: get_capacity_prices(date=None, verbose=False) Pull the most recent capacity market report's market clearing prices :param date: date that will be used to pull latest capacity report (will refer to month and year) :type date: pandas.Timestamp :param verbose: print out requested url. Defaults to False. :type verbose: bool, optional :returns: a DataFrame of monthly capacity prices (all three auctions) for each of the four capacity localities within NYISO .. py:method:: get_fuel_mix(date, end=None, verbose=False) .. py:method:: get_generators(verbose=False) Get a list of generators in NYISO When possible return capacity and fuel type information :param verbose: print out requested url. Defaults to False. :type verbose: bool, optional :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 :rtype: pandas.DataFrame .. py:method:: 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 :rtype: pandas.DataFrame .. py:method:: get_lmp(date, end=None, market: str = None, locations: list = None, location_type: str = None, verbose=False) Supported Markets: - ``REAL_TIME_5_MIN`` - ``DAY_AHEAD_HOURLY`` Supported Location Types: - ``zone`` - ``generator`` .. py:method:: get_load(date, end=None, verbose=False) Returns load at a previous date in 5 minute intervals .. py:method:: get_load_forecast(date, end=None, verbose=False) Get load forecast for a date in 1 hour intervals .. py:method:: get_loads(verbose=False) Get a list of loads in NYISO :param verbose: print out requested url. Defaults to False. :type verbose: bool, optional :returns: a DataFrame of loads and locations :rtype: pandas.DataFrame .. py:method:: get_status(date, end=None, verbose=False) .. py:class:: PJM Bases: :py:obj:`gridstatus.base.ISOBase` PJM **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **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** .. autoapisummary:: :nosignatures: gridstatus.PJM.get_fuel_mix gridstatus.PJM.get_interconnection_queue gridstatus.PJM.get_lmp gridstatus.PJM.get_load gridstatus.PJM.get_load_forecast gridstatus.PJM.get_pnode_ids .. py:method:: get_fuel_mix(date, end=None, verbose=False) Get fuel mix for a date or date range in hourly intervals .. py:method:: get_interconnection_queue(verbose=False) .. py:method:: get_lmp(date, market: str, end=None, locations='hubs', location_type=None, verbose=False) Returns LMP at a previous date .. rubric:: 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 :param date: date to get LMPs for :type date: datetime.date, str :param end: end date to get LMPs for :type end: datetime.date, str :param market: Supported Markets: REAL_TIME_5_MIN, REAL_TIME_HOURLY, DAY_AHEAD_HOURLY :type market: str :param locations: 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!) :type locations: list, optional :param location_type: 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'. :type location_type: str, optional .. py:method:: get_load(date, end=None, verbose=False) Returns load at a previous date at 5 minute intervals :param date: date to get load for. must be in last 30 days :type date: datetime.date, str :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 :rtype: pd.DataFrame .. py:method:: 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 .. py:method:: get_pnode_ids() .. py:class:: SPP Bases: :py:obj:`gridstatus.base.ISOBase` Southwest Power Pool (SPP) **Attributes** .. list-table:: :widths: 15 85 :header-rows: 0 * - **default_timezone** - US/Central * - **interconnection_homepage** - https://www.spp.org/engineering/generator-interconnection/ * - **iso_id** - spp * - **location_types** - None * - **markets** - None * - **name** - Southwest Power Pool * - **status_homepage** - https://www.spp.org/markets-operations/current-grid-conditions/ **Methods** .. autoapisummary:: :nosignatures: gridstatus.SPP.get_fuel_mix gridstatus.SPP.get_interconnection_queue gridstatus.SPP.get_lmp gridstatus.SPP.get_load gridstatus.SPP.get_load_forecast gridstatus.SPP.get_status .. py:method:: get_fuel_mix(date, verbose=False) Get fuel mix :param date: supports today and latest .. note:: if today, returns last 2 hours of data. maybe include previous day :returns: fuel mix :rtype: pd.DataFrame .. py:method:: get_interconnection_queue(verbose=False) Get interconnection queue :returns: Interconnection queue :rtype: pandas.DataFrame .. py:method:: 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_MIN`` - ``DAY_AHEAD_HOURLY`` Supported Location Types: - ``hub`` - ``interface`` - ``settlement_location`` .. py:method:: get_load(date, verbose=False) Returns load for last 24hrs in 5 minute intervals .. py:method:: get_load_forecast(date, forecast_type='MID_TERM', verbose=False) Returns load forecast for next 7 days in hourly intervals :param forecast_type: MID_TERM is hourly for next 7 days or SHORT_TERM is every five minutes for a few hours :type forecast_type: str :returns: forecast for current day :rtype: pd.DataFrame .. py:method:: get_status(date=None, verbose=False)