mstrio.project_objects package

Subpackages

Submodules

mstrio.project_objects.content_cache module

class mstrio.project_objects.content_cache.ContentCache(connection: Connection, id: str, content_cache_dict: dict | None = None)

Bases: Cache, ContentCacheMixin

Manage content cache.

_CACHE_TYPE is a variable used by ContentCache class for cache filtering purposes.

delete(force: bool | None = None) requests.models.Response | None

Delete content cache.

Parameters:

force (bool, optional) – If True, then no additional prompt will be shown before deleting object.

Returns:

Response object.

fetch() None

Fetches the cache from the server, refreshing the variables to match those currently stored on the server.

classmethod from_dict(connection: Connection, caches: list[dict]) list[mstrio.project_objects.content_cache.ContentCache]

Creates Caches from a provided dictionary.

Parameters:
  • cls (object) – Class type for objects to be created

  • connection (Connection) – MicroStrategy connection object returned by connection.Connection()

  • caches (list[dict]) – list of dictionaries the Caches will be created from

Returns:

List of Caches created from the provided dictionaries.

list_properties() dict

List properties for content cache.

load() bool

Load content cache.

unload() bool

Unload content cache.

class mstrio.project_objects.content_cache.ContentCacheFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

BINARY_DATA = 'binary_data'
BINARY_DEFINITION = 'binary_definition'
CSV = 'csv'
EXCEL = 'excel'
FLASH = 'flash'
HTML = 'html'
HTML5 = 'html5'
PDF = 'pdf'
PLAIN_TEXT = 'plain_text'
TRANSACTION = 'transaction'
XML = 'xml'
class mstrio.project_objects.content_cache.ContentCacheStatus(ready: bool, processing: bool, invalid: bool, expired: bool, loaded: bool, filed: bool, dirty: bool)

Bases: Dictable

dirty: bool
expired: bool
filed: bool
invalid: bool
loaded: bool
processing: bool
ready: bool

mstrio.project_objects.dashboard module

class mstrio.project_objects.dashboard.ChapterPage(key: str, visualizations: list[mstrio.project_objects.dashboard.PageVisualization], name: str | None = None, selectors: list[mstrio.project_objects.dashboard.PageSelector] | None = None)

Bases: Dictable

Object that describes a Chapter Page

key

key/id of the page

Type:

string

visualizations

list of visualizations on the page

Type:

list[PageVisualization]

name

name of the page

Type:

string, optional

selectors

list of selectors on the page

Type:

list[PageSelector], optional

key: str
list_properties(camel_case=True) dict

Lists properties of dashboard chapter page.

name: str | None = None
selectors: list[mstrio.project_objects.dashboard.PageSelector] | None = None
visualizations: list[mstrio.project_objects.dashboard.PageVisualization]
class mstrio.project_objects.dashboard.Dashboard(connection: Connection, name: str | None = None, id: str | None = None)

Bases: Document

alter(name: str | None = None, description: str | None = None, folder_id: mstrio.object_management.folder.Folder | str | None = None, hidden: bool | None = None)

Alter Dashboard name, description and/or folder id.

Parameters:
  • name (string, optional) – new name of the Dashboard

  • description (string, optional) – new description of the Dashboard

  • folder_id (string | Folder, optional) – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object Id.

  • hidden (bool, optional) – specifies whether the dashboard is hidden

list_properties() dict

List properties for the dashboard.

publish(recipients: Optional[Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]]] = None)

Publish the dashboard for authenticated user. If recipients parameter is specified publishes the dashboard for the given users.

Parameters:

recipients (UserOrGroup | list[UserOrGroup], optional) – list of users or user groups to publish the dashboard to (can be a list of IDs or a list of User and UserGroup elements)

share_to(users: Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]])

Shares the dashboard to the listed users’ libraries.

Parameters:

users (UserOrGroup | list[UserOrGroup]) – list of users or user groups to publish the dashboard to (can be a list of IDs or a list of User and UserGroup elements).

unpublish(recipients: Optional[Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]]] = None)

Unpublish the dashboard for all users it was previously published to. If recipients parameter is specified unpublishes the dashboard for the given users.

Parameters:

recipients (UserOrGroup | list[UserOrGroup], optional) – list of users or user groups to publish the dashboard to (can be a list of IDs or a list of User and UserGroup elements)

class mstrio.project_objects.dashboard.DashboardChapter(key: str, pages: list[mstrio.project_objects.dashboard.ChapterPage], name: str | None = None, filters: list[dict] | None = None)

Bases: Dictable

Object that describes a Dashboard Chapter

key

key/id of the chapter

Type:

string

pages

list of the chapter pages

Type:

list[ChapterPage]

name

name of the chapter

Type:

string, optional

filters

(dict, optional): filters for the chapter

Type:

list[dict] | None

filters: list[dict] | None = None
key: str
list_properties(camel_case=True) dict

Lists properties of dashboard chapter.

name: str | None = None
pages: list[mstrio.project_objects.dashboard.ChapterPage]
class mstrio.project_objects.dashboard.PageSelector(key: str, selector_type: str, current_selection: dict, source: dict | None = None, multi_selection_allowed: bool = False, has_all_option: bool = False, display_style: str | None = None, available_object_items: list[dict] | None = None, targets: list[dict] | None = None, name: str | None = None, summary: str | None = None)

Bases: Dictable

Object that describes a Page Selector

key

key/id of the selector

Type:

string

selector_type

type of the selector

Type:

string

current_selection

current selection of the selector

Type:

dict

source

source of the selector

Type:

dict, optional

multi_selection_allowed

whether multi selection is allowed, defaults to False

Type:

bool

has_all_option

whether the selector has all options enabled, defaults to False

Type:

bool

display_style

style of the selector display

Type:

string, optional

available_object_items

list of objects available for the selector

Type:

list[dict], optional

targets

list of targets of the selector

Type:

list[dict], optional

name

name of the selector

Type:

string, optional

summary

summary of the selector

Type:

string, optional

available_object_items: list[dict] | None = None
current_selection: dict
display_style: str | None = None
has_all_option: bool = False
key: str
list_properties(camel_case=True) dict

Lists properties of page selector.

multi_selection_allowed: bool = False
name: str | None = None
selector_type: str
source: dict | None = None
summary: str | None = None
targets: list[dict] | None = None
class mstrio.project_objects.dashboard.PageVisualization(key: str, visualization_type: str | None = None, name: str | None = None, selector: mstrio.project_objects.dashboard.VisualizationSelector | None = None)

Bases: Dictable

Object that describes a Visualization on a Page

key

key/id of the visualization

Type:

string

visualization_type

type of the visualization

Type:

string, optional

name

name of the visualization

Type:

string, optional

selector

selector for the visualization

Type:

VisualizationSelector, optional

key: str
list_properties(camel_case=True) dict

Lists properties of page visualization.

name: str | None = None
selector: mstrio.project_objects.dashboard.VisualizationSelector | None = None
visualization_type: str | None = None
class mstrio.project_objects.dashboard.VisualizationSelector(visualization_key: str, selector_type: str, current_selection: dict, targets: list[dict] | None = None)

Bases: Dictable

Object that describes a Visualization Selector

visualization_key

key/id of the selector

Type:

string

selector_type

type of the selector

Type:

string

current_selection

current selection of the selector

Type:

dict

targets

list of the selector’s targets

Type:

list[dict], optional

current_selection: dict
list_properties(camel_case=True) dict

Lists properties of visualization selector.

selector_type: str
targets: list[dict] | None = None
visualization_key: str
mstrio.project_objects.dashboard.list_dashboards(connection: Connection, name: str | None = None, to_dictionary: bool = False, to_dataframe: bool = False, limit: int | None = None, project_id: str | None = None, project_name: str | None = None, **filters) list[mstrio.project_objects.dashboard.Dashboard] | list[dict] | pandas.core.frame.DataFrame

Get all Dashboards stored on the server.

Optionally use to_dictionary or to_dataframe to choose output format. If to_dictionary is True, to_dataframe is omitted.

Parameters:
  • connection (object) – MicroStrategy connection object returned by ‘connection.Connection()’

  • name – characters that the dashboard name must contain

  • to_dictionary (bool, optional) – if True, return Dashboards as list of dicts

  • to_dataframe (bool, optional) – if True, return Dashboards as pandas DataFrame

  • limit (int) – limit the number of elements returned. If None (default), all objects are returned.

  • project_id (str, optional) – Project ID

  • project_name (str, optional) – Project name

  • **filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘acg’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’, ‘project_id’]

Returns:

List of dashboards or list of dictionaries or DataFrame object

mstrio.project_objects.dashboard.list_dashboards_across_projects(connection: Connection, name: str | None = None, to_dictionary: bool = False, to_dataframe: bool = False, limit: int | None = None, **filters) list[mstrio.project_objects.dashboard.Dashboard] | list[dict] | pandas.core.frame.DataFrame

Get all Dashboards stored on the server.

Optionally use to_dictionary or to_dataframe to choose output format. If to_dictionary is True, to_dataframe is omitted.

Parameters:
  • connection (object) – MicroStrategy connection object returned by ‘connection.Connection()’

  • name – characters that the dashboard name must contain

  • to_dictionary (bool, optional) – if True, return Dashboards as list of dicts

  • to_dataframe (bool, optional) – if True, return Dashboards as pandas DataFrame

  • limit – limit the number of elements returned. If None (default), all objects are returned.

  • **filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘acg’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’, ‘project_id’]

Returns:

List of dashboards or list of dictionaries or DataFrame object

mstrio.project_objects.document module

class mstrio.project_objects.document.Document(connection: Connection, name: str | None = None, id: str | None = None)

Bases: Entity, VldbMixin, CopyMixin, MoveMixin, DeleteMixin, ContentCacheMixin, TranslationMixin

Python representation of MicroStrategy Document object

_CACHE_TYPE is a variable used by ContentCache class for cache filtering purposes.

alter(name: str | None = None, description: str | None = None, folder_id: mstrio.object_management.folder.Folder | str | None = None, hidden: bool | None = None)

Alter Document name, description and/or folder id.

Parameters:
  • name (string, optional) – new name of the Document

  • description (string, optional) – new description of the Document

  • folder_id (string | Folder, optional) – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object ID.

  • hidden – Specifies whether the document is hidden

get_connected_cubes() list[mstrio.project_objects.datasets.super_cube.SuperCube | mstrio.project_objects.datasets.olap_cube.OlapCube]

Lists cubes used by this document.

Returns:

A list of cubes used by the document.

list_available_schedules(to_dictionary: bool = False) list[mstrio.distribution_services.schedule.schedule.Schedule] | list[dict]

Get a list of schedules available for the object instance.

Parameters:

to_dictionary (bool, optional) – If True returns a list of dictionaries, otherwise returns a list of Schedules. False by default.

Returns:

List of Schedule objects or list of dictionaries.

list_properties()

List properties for the document.

Returns:

A list of all document properties.

publish(recipients: Optional[Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]]] = None)

Publish the document for authenticated user. If recipients parameter is specified publishes the document for the given users.

Parameters:

recipients (UserOrGroup | list[UserOrGroup], optional) – list of users or user groups to publish the document to (can be a list of IDs or a list of User and UserGroup elements)

share_to(users: Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]])

Shares the document to the listed users’ libraries.

Parameters:

users (UserOrGroup | list[UserOrGroup]) – list of users or user groups to publish the document to (can be a list of IDs or a list of User and UserGroup elements).

unpublish(recipients: Optional[Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]]] = None)

Unpublish the document for all users it was previously published to. If recipients parameter is specified unpublishes the document for the given users.

Parameters:

recipients (UserOrGroup | list[UserOrGroup], optional) – list of users or user groups to publish the document to (can be a list of IDs or a list of User and UserGroup elements)

mstrio.project_objects.document.list_documents(connection: Connection, to_dictionary: bool = False, to_dataframe: bool = False, limit: int | None = None, name: str | None = None, project_id: str | None = None, project_name: str | None = None, **filters) list[mstrio.project_objects.document.Document] | list[dict] | pandas.core.frame.DataFrame

Get all Documents available in the project specified within the connection object.

Optionally use to_dictionary or to_dataframe to choose output format. If to_dictionary is True, to_dataframe is omitted.

Parameters:
  • connection (Connection) – MicroStrategy connection object returned by ‘connection.Connection()’

  • to_dictionary (bool, optional) – if True, return Documents as list of dicts

  • to_dataframe (bool, optional) – if True, return Documents as pandas DataFrame

  • limit (int, optional) – limit the number of elements returned. If None (default), all objects are returned.

  • name (str, optional) – characters that the document name must contain

  • project_id (str, optional) – Project ID

  • project_name (str, optional) – Project name

  • **filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘acg’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’, ‘project_id’]

Returns:

List of documents or list of dictionaries or DataFrame object

mstrio.project_objects.document.list_documents_across_projects(connection: Connection, name: str | None = None, to_dictionary: bool = False, to_dataframe: bool = False, limit: int | None = None, **filters) list[mstrio.project_objects.document.Document] | list[dict] | pandas.core.frame.DataFrame

Get all Documents stored on the server.

Optionally use to_dictionary or to_dataframe to choose output format. If to_dictionary is True, to_dataframe is omitted.

Parameters:
  • connection (Connection) – MicroStrategy connection object returned by ‘connection.Connection()’

  • name (string, optional) – characters that the document name must contain

  • to_dictionary (bool, optional) – if True, return Documents as list of dicts

  • to_dataframe (bool, optional) – if True, return Documents as pandas DataFrame

  • limit (int, optional) – limit the number of elements returned. If None (default), all objects are returned.

  • **filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘acg’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’, ‘project_id’]

Returns:

List of documents or list of dictionaries or DataFrame object

mstrio.project_objects.dossier module

class mstrio.project_objects.dossier.ChapterPage(key: str, visualizations: list[mstrio.project_objects.dossier.PageVisualization], name: str | None = None, selectors: list[mstrio.project_objects.dossier.PageSelector] | None = None)

Bases: Dictable

Object that describes a Chapter Page

key

key/id of the page

Type:

string

visualizations

list of visualizations on the page

Type:

list[PageVisualization]

name

name of the page

Type:

string, optional

selectors

list of selectors on the page

Type:

list[PageSelector], optional

key: str
list_properties(camel_case=True) dict

Lists properties of dossier chapter page.

name: str | None = None
selectors: list[mstrio.project_objects.dossier.PageSelector] | None = None
visualizations: list[mstrio.project_objects.dossier.PageVisualization]
class mstrio.project_objects.dossier.Dossier(connection: Connection, name: str | None = None, id: str | None = None)

Bases: Document

alter(name: str | None = None, description: str | None = None, folder_id: mstrio.object_management.folder.Folder | str | None = None, hidden: bool | None = None)

Alter Dossier name, description and/or folder id.

Parameters:
  • name (string, optional) – new name of the Dossier

  • description (string, optional) – new description of the Dossier

  • folder_id (string | Folder, optional) – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object Id.

  • hidden (bool, optional) – specifies whether the dossier is hidden

list_properties() dict

List properties for the dossier.

publish(recipients: Optional[Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]]] = None)

Publish the dossier for authenticated user. If recipients parameter is specified publishes the dossier for the given users.

Parameters:

recipients (UserOrGroup | list[UserOrGroup], optional) – list of users or user groups to publish the dossier to (can be a list of IDs or a list of User and UserGroup elements)

share_to(users: Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]])

Shares the dossier to the listed users’ libraries.

Parameters:

users (UserOrGroup | list[UserOrGroup]) – list of users or user groups to publish the dossier to (can be a list of IDs or a list of User and UserGroup elements).

unpublish(recipients: Optional[Union[str, User, UserGroup, list[Union[str, mstrio.users_and_groups.user.User, mstrio.users_and_groups.user_group.UserGroup]]]] = None)

Unpublish the dossier for all users it was previously published to. If recipients parameter is specified unpublishes the dossier for the given users.

Parameters:

recipients (UserOrGroup | list[UserOrGroup], optional) – list of users or user groups to publish the dossier to (can be a list of IDs or a list of User and UserGroup elements)

class mstrio.project_objects.dossier.DossierChapter(key: str, pages: list[mstrio.project_objects.dossier.ChapterPage], name: str | None = None, filters: list[dict] | None = None)

Bases: Dictable

Object that describes a Dossier Chapter

key

key/id of the chapter

Type:

string

pages

list of the chapter pages

Type:

list[ChapterPage]

name

name of the chapter

Type:

string, optional

filters

(dict, optional): filters for the chapter

Type:

list[dict] | None

filters: list[dict] | None = None
key: str
list_properties(camel_case=True) dict

Lists properties of dossier chapter.

name: str | None = None
pages: list[mstrio.project_objects.dossier.ChapterPage]
class mstrio.project_objects.dossier.PageSelector(key: str, selector_type: str, current_selection: dict, source: dict | None = None, multi_selection_allowed: bool = False, has_all_option: bool = False, display_style: str | None = None, available_object_items: list[dict] | None = None, targets: list[dict] | None = None, name: str | None = None, summary: str | None = None)

Bases: Dictable

Object that describes a Page Selector

key

key/id of the selector

Type:

string

selector_type

type of the selector

Type:

string

current_selection

current selection of the selector

Type:

dict

source

source of the selector

Type:

dict, optional

multi_selection_allowed

whether multi selection is allowed, defaults to False

Type:

bool

has_all_option

whether the selector has all options enabled, defaults to False

Type:

bool

display_style

style of the selector display

Type:

string, optional

available_object_items

list of objects available for the selector

Type:

list[dict], optional

targets

list of targets of the selector

Type:

list[dict], optional

name

name of the selector

Type:

string, optional

summary

summary of the selector

Type:

string, optional

available_object_items: list[dict] | None = None
current_selection: dict
display_style: str | None = None
has_all_option: bool = False
key: str
list_properties(camel_case=True) dict

Lists properties of page selector.

multi_selection_allowed: bool = False
name: str | None = None
selector_type: str
source: dict | None = None
summary: str | None = None
targets: list[dict] | None = None
class mstrio.project_objects.dossier.PageVisualization(key: str, visualization_type: str | None = None, name: str | None = None, selector: mstrio.project_objects.dossier.VisualizationSelector | None = None)

Bases: Dictable

Object that describes a Visualization on a Page

key

key/id of the visualization

Type:

string

visualization_type

type of the visualization

Type:

string, optional

name

name of the visualization

Type:

string, optional

selector

selector for the visualization

Type:

VisualizationSelector, optional

key: str
list_properties(camel_case=True) dict

Lists properties of page visualization.

name: str | None = None
selector: mstrio.project_objects.dossier.VisualizationSelector | None = None
visualization_type: str | None = None
class mstrio.project_objects.dossier.VisualizationSelector(visualization_key: str, selector_type: str, current_selection: dict, targets: list[dict] | None = None)

Bases: Dictable

Object that describes a Visualization Selector

visualization_key

key/id of the selector

Type:

string

selector_type

type of the selector

Type:

string

current_selection

current selection of the selector

Type:

dict

targets

list of the selector’s targets

Type:

list[dict], optional

current_selection: dict
list_properties(camel_case=True) dict

Lists properties of visualization selector.

selector_type: str
targets: list[dict] | None = None
visualization_key: str
mstrio.project_objects.dossier.list_dossiers(connection: Connection, name: str | None = None, to_dictionary: bool = False, to_dataframe: bool = False, limit: int | None = None, project_id: str | None = None, project_name: str | None = None, **filters) list[mstrio.project_objects.dossier.Dossier] | list[dict] | pandas.core.frame.DataFrame

Get all Dossiers stored on the server.

Optionally use to_dictionary or to_dataframe to choose output format. If to_dictionary is True, to_dataframe is omitted.

Parameters:
  • connection (object) – MicroStrategy connection object returned by ‘connection.Connection()’

  • name – characters that the dossier name must contain

  • to_dictionary (bool, optional) – if True, return Dossiers as list of dicts

  • to_dataframe (bool, optional) – if True, return Dossiers as pandas DataFrame

  • limit (int) – limit the number of elements returned. If None (default), all objects are returned.

  • project_id (str, optional) – Project ID

  • project_name (str, optional) – Project name

  • **filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘acg’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’, ‘project_id’]

Returns:

List of dossiers or list of dictionaries or DataFrame object

mstrio.project_objects.dossier.list_dossiers_across_projects(connection: Connection, name: str | None = None, to_dictionary: bool = False, to_dataframe: bool = False, limit: int | None = None, **filters) list[mstrio.project_objects.dossier.Dossier] | list[dict] | pandas.core.frame.DataFrame

Get all Dossiers stored on the server.

Optionally use to_dictionary or to_dataframe to choose output format. If to_dictionary is True, to_dataframe is omitted.

Parameters:
  • connection (object) – MicroStrategy connection object returned by ‘connection.Connection()’

  • name – characters that the dossier name must contain

  • to_dictionary (bool, optional) – if True, return Dossiers as list of dicts

  • to_dataframe (bool, optional) – if True, return Dossiers as pandas DataFrame

  • limit – limit the number of elements returned. If None (default), all objects are returned.

  • **filters – Available filter parameters: [‘name’, ‘id’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘acg’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’, ‘project_id’]

Returns:

List of dossiers or list of dictionaries or DataFrame object

mstrio.project_objects.library module

class mstrio.project_objects.library.Library(connection: Connection, project_id: str | None = None, project_name: str | None = None)

Bases: object

publish(contents: Union[list, Dashboard, Document, Dossier, str])

Publishes dashboard, dossier or document to the authenticated user’s library.

contents: dashboards, dossiers or documents to be published,

can be Dashboard/Dossier/Document class object or ID

unpublish(contents: Union[list, Dashboard, Document, Dossier, str])

Publishes dashboard, dossier or document to the authenticated user’s library.

contents: dashboards, dossiers or documents to be published,

can be Dashboard/Dossier/Document class object or ID

mstrio.project_objects.report module

class mstrio.project_objects.report.Report(connection: Connection, id: str, instance_id: str | None = None, parallel: bool = True, progress_bar: bool = True)

Bases: Entity, CertifyMixin, CopyMixin, MoveMixin, DeleteMixin, ContentCacheMixin, TranslationMixin

Access, filter, publish, and extract data from in-memory reports.

Create a Report object to load basic information on a report dataset. Specify subset of report to be fetched through Report.apply_filters() and Report.clear_filters(). Fetch dataset through Report.to_dataframe() method.

_CACHE_TYPE is a variable used by ContentCache class for cache filtering purposes.

connection

MicroStrategy connection object returned by connection.Connection().

id

Identifier of a pre-existing report containing the required data.

name

Report name

description

Report description

abbreviation

Report abbreviation

instance_id

Identifier of an instance if report instance has been already initialized, NULL by default.

type

Object type

subtype

Object subtype

ext_type

Object extended type

date_created

Creation time, DateTime object

date_modified

Last modification time, DateTime object

version

Version ID

owner

owner User object

view_media

View media information

ancestors

List of ancestor folders

certified_info

Information whether report is certified or not, CertifiedInfo object

attributes

List of attributes

metrics

List of metrics

attr_elements

All attributes elements of report

selected_attributes

IDs of filtered attributes

selected_metrics

IDs of filtered metrics

selected_attr_elements

IDs of filtered attribute elements

dataframe

content of a report extracted into a Pandas DataFrame

acg

Access rights (See EnumDSSXMLAccessRightFlags for possible values)

acl

Object access control list

alter(name: str | None = None, description: str | None = None, abbreviation: str | None = None, hidden: bool | None = None)

Alter Report properties.

Parameters:
  • name – new name of the Report

  • description – new description of the Report

  • abbreviation – new abbreviation of the Report

  • hidden – Specifies whether the metric is hidden

apply_filters(attributes: list | None = None, metrics: list | None = None, attr_elements: list | None = None, operator: str = 'In') None

Apply filters on the reports’s objects.

Filter by attributes, metrics and attribute elements.

Parameters:
  • attributes (list or None, optional) – ids of attributes to be included in the filter. If list is empty, no attributes will be selected and metric data will be aggregated.

  • metrics (list or None, optional) – ids of metrics to be included in the filter. If list is empty, no metrics will be selected.

  • attr_elements (list or None, optional) – attribute elements to be included in the filter.

  • operator (str, optional) – a str flag used to specify if the attribute elements selected inside the filter should be included or excluded. Allowed values are: ‘In’, ‘NotIn’.

clear_filters() None

Clear previously set filters, allowing all attributes, metrics, and attribute elements to be retrieved.

list_available_schedules(to_dictionary: bool = False) list[mstrio.distribution_services.schedule.schedule.Schedule] | list[dict]

Get a list of schedules available for the report.

Parameters:

to_dictionary (bool, optional) – If True returns a list of dictionaries, otherwise returns a list of Schedules. False by default.

Returns:

List of Schedule objects or list of dictionaries.

list_properties()

List all properties of the object.

to_dataframe(limit: int | None = None) DataFrame

Extract contents of a report instance into a Pandas DataFrame.

Parameters:

limit (None or int, optional) – Used to control data extract behavior. By default (None) the limit is calculated automatically, based on an optimized physical size of one chunk. Setting limit manually will force the number of rows per chunk. Depending on system resources, a higher limit (e.g. 50,000) may reduce the total time required to extract the entire dataset.

Returns:

Pandas Data Frame containing the report contents.

mstrio.project_objects.report.list_reports(connection: Connection, name: str | None = None, search_pattern: mstrio.object_management.search_enums.SearchPattern | int = SearchPattern.CONTAINS, project_id: str | None = None, project_name: str | None = None, to_dictionary: bool = False, limit: int | None = None, folder_id: str | None = None, **filters) list[type[mstrio.project_objects.report.Report]] | list[dict]

Get list of Report objects or dicts with them. Optionally filter reports by specifying ‘name’.

Optionally use to_dictionary to choose output format.

Wildcards available for ‘name’:

? - any character * - 0 or more of any characters e.g. name = ?onny will return Sonny and Tonny

Specify either project_id or project_name. When project_id is provided (not None), project_name is omitted.

Note

When project_id is None and project_name is None, then its value is overwritten by project_id from connection object.

Parameters:
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name (string, optional) – value the search pattern is set to, which will be applied to the names of reports being searched

  • to_dictionary (bool, optional) – If True returns dict, by default (False) returns Report objects

  • search_pattern (SearchPattern enum or int, optional) – pattern to search for, such as Begin With or Contains. Possible values are available in ENUM mstrio.object_management.SearchPattern. Default value is BEGIN WITH (4).

  • project_id (string, optional) – Project ID

  • project_name (string, optional) – Project name

  • limit (integer, optional) – limit the number of elements returned. If None all object are returned.

  • folder_id (string, optional) – ID of a folder where the search will be performed. Defaults to None.

  • **filters – Available filter parameters: [‘id’, ‘name’, ‘type’, ‘subtype’, ‘date_created’, ‘date_modified’, ‘version’, ‘owner’, ‘ext_type’, ‘view_media’, ‘certified_info’]

Returns:

list with Report objects or list of dictionaries

Module contents