Access to the Alberta Interconnected Electric System Event log. The raw log is accessible at <http://ets.aeso.ca/ets_web/ip/Market/Reports/RealTimeShiftReportServlet>.
Warning
This module is deprecated and slated for removal. Please use aeso.eventlog instead.
The aeso.aieslog module defines the following functions:
Returns an open file-object connected to AESO’s Alberta Interconnected Electric System (AIES) event log webservice.
Parameters: | timeout – optional parameter specifying timeout in seconds for blocking operations like the connection attempt. If operation times out urllib2.URLError will be raised. ValueError will be raised in Python 2.4 and 2.5 if this parameter is set to anything but None. |
---|---|
Return type: | file-like object. |
New in version 0.6.
New in version 0.7: timeout parameter.
Yields (LogEntry, str) objects containing event datetime and description as extracted from file-like object f. As always with pyaeso, datetimes are UTC offset-aware and should be converted to localized datetimes before being displayed to the user.
New in version 0.6.
>>> from aeso import eventlog
>>> from aeso import AB_TZ
>>>
>>> from datetime import datetime
>>> f = eventlog.urlopen()
>>> for utc_dt, msg in eventlog.parse_eventlog_file(f):
... # Convert UTC to Alberta timezone before printing
... ab_dt = AB_TZ.normalize(utc_dt.astimezone(AB_TZ))
... assert type(ab_dt) == datetime
... assert type(msg) == str # Event description
...
>>> f.close()