gs_quant.markets.baskets.Basket.get_identifier

Basket.get_identifier(id_type, as_of=None)

Get asset identifier

Parameters:
  • as_of (Optional[date]) – As of date for query

  • id_type (AssetIdentifier) – requested id type

Returns:

identifier value

Usage

Get asset identifier as of a given date. Where the identifiers are temporal (and can change over time), this function will return the identifier as of that point in time. If no date is provided as a parameter, will use the current PricingContext.

Examples

Get current SEDOL:

>>> import datetime as dt
>>>
>>> gs = SecurityMaster.get_asset("GS", AssetIdentifier.TICKER)
>>> gs.get_identifier(AssetIdentifier.SEDOL)

Get SEDOL as of 1Jan18:

>>> gs.get_identifier(AssetIdentifier.SEDOL, as_of=dt.date(2018,1,1))

Use PricingContext to determine as of date:

>>> with PricingContext(dt.date(2018,1,1)) as ctx:
>>>     gs.get_identifier(AssetIdentifier.SEDOL)

See also

AssetIdentifier get_asset_identifiers()