Helper functions to access AESO’s raw ETS pool price report as published by AESO at <http://ets.aeso.ca/ets_web/ip/Market/Reports/HistoricalPoolPriceReportServlet>.
Represents the market equilibrium price and quantity exchanged at a given point in time.
decimal.Decimal property.
Extracts a QpPoint object from a sequece object like: [‘08/10/2009 15’, ‘67.36’, ‘39.67’, ‘8623.0’].
decimal.Decimal property.
datetime.datetime property.
Downloads market equilibrium data from ETS and writes it to the file object f_out. Unlike urlopen_pool_price there is no restriction on the amount of data that can be requested. Internally an iterator is used to query data in 721 day blocks before it is written to f_out.
Parameters: |
|
---|
New in version 0.7: timeout parameter.
Usage example:
>>> # Standard Libraries
>>> from datetime import date
>>> from datetime import timedelta
>>> try:
... # Python 3
... from io import BytesIO
... except ImportError:
... # Python 2.x
... from StringIO import StringIO as BytesIO
>>>
>>> # Import 3rd party libraries
>>> from aeso import equilibrium
>>>
>>> end_date = date.today()
>>> start_date = end_date - timedelta(1)
>>>
>>> f = BytesIO()
>>> try:
... equilibrium.dump_equilibrium(f, start_date, end_date)
... assert len(f.getvalue()) > 0
... finally:
... f.close()
Yields QpPoint objects as extracted from the open CSV file-object f.
Usage example:
>>> # Standard library imports
>>> from datetime import date
>>> from datetime import timedelta
>>> try:
... from io import BytesIO
... except ImportError:
... from StringIO import StringIO as BytesIO
>>>
>>> # 3rd Party Libraries
>>> import aeso
>>> from aeso import equilibrium
>>>
>>> end_date = date.today()
>>> start_date = end_date - timedelta(1)
>>>
>>> f = BytesIO()
>>> try:
... equilibrium.dump_equilibrium(f, start_date, end_date)
... ofs = f.seek(0)
... data = list(equilibrium.parse_equilibrium_file(f))
... assert len(data) > 0
... finally:
... f.close()
>>>
>>> # Yesterday's market clearing price/demand points.
>>> for d in data:
... ab_time = AB_TZ.normalize(d.t.astimezone(aeso.AB_TZ))
... # print '{0} ${1} {2}MW'.format(ab_time, d.price, d.demand)
Returns a file-like object attached to the ETS pool price report webservice. Note that the webservice limits the number of days that can be queried to 721 days (as of 2009-11-12).
Parameters: |
|
---|---|
Return type: | file-like object. |
New in version 0.7: timeout parameter.
Usage example:
>>> # Standard library imports
>>> from datetime import date
>>> from datetime import timedelta
>>>
>>> # 3rd Party Libraries
>>> from aeso import equilibrium
>>>
>>> end_date = date.today()
>>> start_date = end_date - timedelta(1)
>>>
>>> f = equilibrium.urlopen(start_date, end_date)
... try:
... bytes = f.read()
... assert len(bytes) > 0
... finally:
... f.close()