ThematicReport

class ThematicReport(report_id=None, name=None, position_source_id=None, parameters=None, position_source_type=None, report_type=None, earliest_start_date=None, latest_end_date=None, latest_execution_time=None, status=ReportStatus.new, percentage_complete=None, **kwargs)[source]

Historical analyses on the exposure of a portfolio to various GS Flagship Thematic baskets over a date range

Methods

__init__(report_id=None, name=None, position_source_id=None, parameters=None, position_source_type=None, report_type=None, earliest_start_date=None, latest_end_date=None, latest_execution_time=None, status=ReportStatus.new, percentage_complete=None, **kwargs)[source]

Historical analyses on the exposure of a portfolio to various GS Flagship Thematic baskets over a date range

Parameters:
  • report_id (Optional[str]) – Marquee report ID

  • name (Optional[str]) – report name

  • position_source_id (Optional[str]) – position source ID

  • parameters (Optional[ReportParameters]) – parameters of the report

  • position_source_type (Union[str, PositionSourceType, None]) – position source (i.e. ‘Portfolio’, ‘Asset’, or ‘Hedge’)

  • report_type (Union[str, ReportType, None]) – report type (i.e. ‘Portfolio Thematic Analytics’ or ‘Asset Thematic Analytics’)

  • earliest_start_date (Optional[date]) – start date of report

  • latest_end_date (Optional[date]) – end date of report

  • latest_execution_time (Optional[datetime]) – date of the latest execution

  • status (Union[str, ReportStatus]) – status of of report (i.e. ‘ready’, ‘executing’, or ‘done’)

  • percentage_complete (Optional[float]) – percent of the report that is complete

Examples

>>> thematic_report = ThematicReport(
>>>     report_id='REPORTID',
>>>     position_source_type=PositionSourceType.Portfolio,
>>>     position_source_id='PORTFOLIOID',
>>>     parameters=None
>>> )
delete()

Delete a report from Marquee

classmethod from_target(report)[source]
classmethod get(report_id, **kwargs)[source]

Get a thematic report from the unique report identifier

Parameters:

report_id (str) – Marquee report ID

Returns:

returns a ThematicReport object that correlates to the Marquee report

get_all_thematic_exposures(start_date=None, end_date=None, basket_ids=None, regions=None)[source]

Get all portfolio thematic analytics for GS Flagshop Thematic baskets

Parameters:
  • start_date (Optional[date]) – start date

  • end_date (Optional[date]) – end date

  • basket_ids (Optional[List[str]]) – optional list of thematic basket IDs to include; defaults to all of them

  • regions (Optional[List[Region]]) – regions by which to filter flagship thematic baskets; defaults to all regions

Return type:

DataFrame

Returns:

a Pandas DataFrame with results

get_bottom_five_thematic_exposures(start_date=None, end_date=None, basket_ids=None, regions=None)[source]

Get portfolio thematic analytics for the five GS Flagship Thematic baskets with the lowest thematic exposures

Parameters:
  • start_date (Optional[date]) – start date

  • end_date (Optional[date]) – end date

  • basket_ids (Optional[List[str]]) – optional list of thematic basket IDs to include; defaults to all of them

  • regions (Optional[List[Region]]) – regions by which to filter flagship thematic baskets; defaults to all regions

Return type:

DataFrame

Returns:

a Pandas DataFrame with the bottom 5 results

get_most_recent_job()

Retrieve the most current report job

get_thematic_betas(start_date=None, end_date=None, basket_ids=None)[source]

Get portfolio historical beta to GS Flagship Thematic baskets

Parameters:
  • start_date (Optional[date]) – start date

  • end_date (Optional[date]) – end date

  • basket_ids (Optional[List[str]]) – optional list of thematic basket IDs to include; defaults to all of them

Return type:

DataFrame

Returns:

a Pandas DataFrame with results

get_thematic_breakdown(date, basket_id)[source]

Get a by-asset breakdown of a portfolio or basket’s thematic exposure to a particular flagship basket on a particular date

Parameters:
  • date (date) – date

  • basket_id (str) – GS flagship basket’s unique Marquee ID

Return type:

DataFrame

Returns:

a Pandas DataFrame with results

get_thematic_data(start_date=None, end_date=None, basket_ids=None)[source]

Get all results from the thematic report for a date range

Parameters:
  • start_date (Optional[date]) – start date

  • end_date (Optional[date]) – end date

  • basket_ids (Optional[List[str]]) – optional list of thematic basket IDs to include; defaults to all of them

Return type:

DataFrame

Returns:

a Pandas DataFrame with results

get_thematic_exposure(start_date=None, end_date=None, basket_ids=None)[source]

Get portfolio historical exposure to GS Flagship Thematic baskets

Parameters:
  • start_date (Optional[date]) – start date

  • end_date (Optional[date]) – end date

  • basket_ids (Optional[List[str]]) – optional list of thematic basket IDs to include; defaults to all of them

Return type:

DataFrame

Returns:

a Pandas DataFrame with results

get_top_five_thematic_exposures(start_date=None, end_date=None, basket_ids=None, regions=None)[source]

Get portfolio thematic analytics for the five GS Flagship Thematic baskets with the highest thematic exposures

Parameters:
  • start_date (Optional[date]) – start date

  • end_date (Optional[date]) – end date

  • basket_ids (Optional[List[str]]) – optional list of thematic basket IDs to include; defaults to all of them

  • regions (Optional[List[Region]]) – regions by which to filter flagship thematic baskets; defaults to all regions

Return type:

DataFrame

Returns:

a Pandas DataFrame with the top 5 results

run(start_date=None, end_date=None, backcast=False, is_async=True)

Run a report with the given date range

Parameters:
  • start_date (Optional[date]) – start date (optional)

  • end_date (Optional[date]) – end date (optional)

  • backcast (bool) – set to true if the report should be backcasted; defaults to false

  • is_async (bool) – return immediately (true) or wait for results (false); defaults to true

save()

Create a report in Marquee if it doesn’t exist. Update the report if it does.

schedule(start_date=None, end_date=None, backcast=None)

Schedule a report with the given date range

Parameters:
  • start_date (Optional[date]) – start date (optional)

  • end_date (Optional[date]) – end date (optional)

  • backcast (Optional[bool]) – set to true if the report should be backcasted

set_position_source(entity_id)

Set position source type and position source ID