Utils#

Module Contents#

Functions#

convert_bool_to_emoji

If value is boolean, convert to Green Checkmark or Red X. Otherwise, leave be.

download_csvs_from_zip_url

filter_lmp_locations

Filters DataFrame by locations, which can be a list, "ALL" or None

format_interconnection_df

Format interconnection queue data

get_interconnection_queues

Get interconnection queue data for all ISOs

get_iso

Get an ISO by its id

get_response_blob

get_zip_file

get_zip_folder

is_dst_end

is_today

is_within_last_days

Returns whether date is within N days

list_isos

List available ISOs

load_folder

Load a single DataFrame for same schema csv files in a folder

make_availability_df

make_availability_table

make_lmp_availability_df

make_lmp_availability_table

move_cols_to_front

Move columns to front of DataFrame

Attributes Summary#

all_isos

GREEN_CHECKMARK_HTML_ENTITY

LMP_METHOD_NAMES

RED_X_HTML_ENTITY

Contents#

gridstatus.utils.all_isos[source]#
gridstatus.utils.convert_bool_to_emoji(value)[source]#

If value is boolean, convert to Green Checkmark or Red X. Otherwise, leave be.

gridstatus.utils.download_csvs_from_zip_url(url, process_csv=None, verbose=False)[source]#
gridstatus.utils.filter_lmp_locations(df, locations=None, location_type=None)[source]#

Filters DataFrame by locations, which can be a list, “ALL” or None

Parameters:
  • df (pandas.DataFrame) – DataFrame to filter

  • locations – “ALL” or list of locations to filter “Location” column by

gridstatus.utils.format_interconnection_df(queue, rename, extra=None, missing=None)[source]#

Format interconnection queue data

gridstatus.utils.get_interconnection_queues()[source]#

Get interconnection queue data for all ISOs

gridstatus.utils.get_iso(iso_id)[source]#

Get an ISO by its id

gridstatus.utils.get_response_blob(resp: requests.Response) io.BytesIO[source]#
gridstatus.utils.get_zip_file(url, verbose=False)[source]#
gridstatus.utils.get_zip_folder(url, verbose=False)[source]#
gridstatus.utils.GREEN_CHECKMARK_HTML_ENTITY = '✅'[source]#
gridstatus.utils.is_dst_end(date)[source]#
gridstatus.utils.is_today(date, tz)[source]#
gridstatus.utils.is_within_last_days(date, days, tz)[source]#

Returns whether date is within N days

gridstatus.utils.list_isos()[source]#

List available ISOs

gridstatus.utils.LMP_METHOD_NAMES = ['get_lmp', 'get_spp'][source]#
gridstatus.utils.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

gridstatus.utils.make_availability_df()[source]#
gridstatus.utils.make_availability_table()[source]#
gridstatus.utils.make_lmp_availability_df()[source]#
gridstatus.utils.make_lmp_availability_table()[source]#
gridstatus.utils.move_cols_to_front(df, cols_to_move)[source]#

Move columns to front of DataFrame

gridstatus.utils.RED_X_HTML_ENTITY = '❌'[source]#