Skip to content

Report

Interactive dashboards that present portfolio analytics information in an intuitive and explorable way. Reports represent a specific portfolio and date so that they can be referenced in the future.

We can start using the Report entity by running the following import statement:

from everysk.sdk.entities import Report

Below we have the most common class attributes used in the Report entity:

  • script: The script used to generate the report.

  • name: The name of the report.

  • description: The description of the report.

  • tags: The tags associated with the report.

  • workspace: The workspace where the report is stored.

  • date: The date the report was created.

  • widgets: The widgets associated with the report.

  • url: The URL of the report.

  • authorization: The type of authorization in the report.

  • config_cascaded: The different configurations in the report.

  • layout_content: How the layout of the content will be structured.

Instantiating a Report Entity

Below we have a code segment demonstrating how to instantiate a Report entity and set its class attributes:

report = Report()
report.script = 'my_script'
report.name = 'My Report'
report.description = 'This is a report'
report.tags = ['tag1', 'tag2']
report.workspace = 'my_workspace'
report.date = '20210101'
report.widgets = [{'type': 'chart', 'data': {...}}, {'type': 'table', 'data': {...}}]
report.url = '/my_report_url'
report.authorization = 'private'
report.config_cascaded = {'config1': 'value1', 'config2': 'value2'}
report.layout_content = {'section1': {...}, 'section2': {...}}

Converting Report to a Dictionary

Most times when working with entities, there might be a point where we need to convert the entity to a dictionary, and to achieve this we simply use the to_dict() method:

report = Report()
type(report)
everysk.sdk.entities.report.base.Report

to_dict = report.to_dict()
type(to_dict)
# dict