get_all_isos
method
A helper method to get a list of all the ISOs in the database. Useful to confirm naming convention or if looping across ISOs. This method has no parameters and returns a list of the following ISOs:
services = client.services
class Services(object):
def __init__(self, client):
self.client = client
self.ancillary = Ancillary(self)
self.lmp = LMP(self)
def get(self, route, params=None):
return self.client.get(f"services/{route}", params=params)
def get_all_isos(self):
return self.get("isos")
Market
object
An object for the various LMP market types, which are:
Sub-objects
DA
enum
For the Day-Ahead Energy Market.
RT
enum
For the Real-Time Energy Market.
get_all_nodes
method
A method to get all the nodes in a selected ISO. Useful for determining node attributes. For list of ISOs, use this method.
Parameters
iso
string
The ISO of nodes to be pulled.
Returns
id
string
The unique ID of a node. Used for fetching prices.
name
string
The name of a node as defined by the relevant ISO.
zone
string
The zone of the node. Note that definitions of zones vary across ISO. In addition, the term zone sometimes refers to load zones, transmission regions, or capacity zones. The definition used for this parameter is that used by the specific ISO for its energy market.
type
string
The type of node. Node types include generator, load, interface, aggregate, inter-tie, zone, and hub.
substation
string
If relevant, the associated substation of the node.
da_start_year
int
The first year with pricing history in the day-ahead market for a specific node.
da_end_year
int
The last year with pricing history in the day-ahead market for a specific node.
rt_start_yea
int
The first year with pricing history in the real-time market for a specific node.
rt_end_year
int
The last year with pricing history in the real-time market for a specific node.
get_prices
method
A method to pull historical pricing data for a list of nodes. To figure out the node id for a node, refer to the [get_all_nodes](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
table for that iso.
Parameters
node_ids
list of strings
id
(s) for each requested node. A maximum of 10 nodes can be requested.
market
object
The LMP market type of the requested prices. Refer to the [Market](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
object
start_year
int
The first year to pull pricing data. If data requested outside of range for that node, a 422 error will be thrown.
end_year
int
The last year to pull pricing data. If data requested outside of range for that node, a 422 error will be thrown.
Returns
datetimes
list of datetimes
The date and time interval for a LMP price print. This returns in the local time of the node, with the relevant daylight savings time treatment. This means that timestamps are the clock time at the start of the interval, or Hour Beginning for hourly prices.
prices
list of floats
The price print for the date-time interval. The units for prices LMP are $/MWh.
services = client.services
lmp = services.lmp
class LMP(object):
def __init__(self, prices):
self.prices = prices
def get(self, route, params=None):
return self.prices.get(f"lmp/{route}", params=params)
def get_all_nodes(self, *, iso):
return self.get("nodes", {"iso": iso})
def get_prices(self, *, node_ids, market, start_year, end_year):
return self.get("prices", {"node_ids": json.dumps(node_ids),
"market": market,
"start_year": start_year,
"end_year": end_year})
AncillaryService
object
An object for the various Ancillary Services, which are:
Sub-objects
REGULATION_UP
enum
For the Regulation Up service.
REGULATION_DOWN
enum
For the Regulation Down service.
RESERVES
enum
For the Spinning Reserve service (or equivalent fastest responding service for the ISO).
get_pricing_regions
method
A method to get all the pricing regions in a selected iso and service. While system-wide Ancillary Services procurement is most common, a handful of ISOs have sub-regions for all or specific services. For list of ISOs, use this method. For a list of services, tab-complete using the [AncillaryService](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
object or refer to the above.
Parameters
iso
string
The ISO of pricing regions to be pulled.
service
string
The service of pricing regions to be pulled. Refer to the [AncillaryService](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
object.
Returns
region
object
The name of the pricing region. For technical documentation on how these regions are defined, refer to this page (coming soon).
start_year
int
The first year of available pricing data.
end_year
int
The last year of available pricing data.
get_prices
method
A method to pull historical pricing data for a specific ISO and pricing region. To figure out the relevant pricing region, refer to the [get_pricing_regions](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
table for that iso & service.
Parameters
iso
string
The ISO of the requested Ancillary Service prices.
service
string
The service of the requested Ancillary Service prices. Refer to the [AncillaryService](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
object.
market
object
The market type of the requested Ancillary Service prices. Refer to the [Market](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
object
region
object
The pricing region of the requested Ancillary Service prices. Refer to the [get_pricing_region](<https://tyba.notion.site/Prices-797c388f6ceb46ad90ba10d19dac6e8f>)
method.
start_year
int
The first year to pull pricing data. If data requested outside of range for that node, a 422 error will be thrown.
end_year
int
The last year to pull pricing data. If data requested outside of range for that node, a 422 error will be thrown.