aeso.asset — Alberta Generation Assets

Helpers to access AESO’s asset list at <http://ets.aeso.ca/ets_web/ip/Market/Reports/AssetListReportServlet>.

class aeso.asset.Asset(asset_name, asset_id, asset_type, status, participant_name, participant_id)

Represents an asset be it an AssetType.SINK and AssetType.SOURCE

New in version 0.6.

asset_id

str property.

asset_name

str property.

asset_type

AssetType property.

participant_id

str property.

participant_name

str property.

status

AssetStatus property.

class aeso.asset.AssetStatus

Asset state enumeration.

New in version 0.6.

ACTIVE
INACTIVE
RETIRED
SUSPENDED
classmethod from_str(klass, string)

Converts some simple strings to enumeration values.

class aeso.asset.AssetType

Asset type enumeration.

New in version 0.6.

SINK
SOURCE
classmethod from_str(klass, string)

Converts some simple strings to enumeration values.

aeso.asset.dump_asset_list(f_out, timeout=None)

Downloads asset list report and writes it to file-object f.

Parameters:
  • f_out – file-like object to write asset list to.
  • 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.

New in version 0.6.

New in version 0.7: timeout parameter.

Usage example:

>>> try:
...   from io import BytesIO
... except ImportError:
...   from StringIO import StringIO as BytesIO
>>> # 3rd Party Libraries
>>> from aeso import asset
>>>
>>> f = BytesIO()
>>> try:
...   asset.dump_asset_list(f)
... finally:
...   f.close()
aeso.asset.parse_asset_list_file(f)

Yields Asset objects extracted from the open file-object f.

New in version 0.6.

Usage example:

>>> # 3rd Party Libraries
>>> from aeso import asset
>>>
>>>
>>> f = asset.urlopen_asset_list()
>>> assets = list(asset.parse_asset_list_file(f))
>>> f.close()
aeso.asset.urlopen_asset_list(timeout=None)

Returns a file-like object containing data returned by the ETS asset list 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.

Usage example:

>>> # 3rd Party Libraries
>>> from aeso import asset
>>>
>>> f = asset.urlopen_asset_list()
>>> text = f.read()
>>> f.close()

Note

The raw ETS asset list report can be accessed at <http://ets.aeso.ca/ets_web/ip/Market/Reports/AssetListReportServlet>.

Previous topic

Download and Install

Next topic

aeso.atc — Available transfer capacity limits

This Page