mstrio > project_objects > library

class mstrio.project_objects.library.Library(connection, project_id=None, project_name=None)

Bases: object

Representation of the state of the authenticated user’s Library. It contains the references to the documents, dashboards, and reports that have been shared to the user’s Library.

Parameters:
  • connection (Connection) –

  • project_id (str | None) –

  • project_name (str | None) –

connection

Strategy One connection object returned by connection.Connection().

Type:

Connection

project_id

ID of the project that the Library is in.

Type:

str

project_name

Name of the project that the Library is in.

Type:

str

user_id

ID of the authenticated user.

Type:

str

documents

List of documents in the Library.

Type:

list[Document]

dashboards

List of dashboards in the Library.

Type:

list[Dashboard]

contents

List of all contents (documents and dashboards) in the Library.

Type:

list[Document | Dashboard]

fetch()
list_library_shortcuts()

List all library shortcuts in the authenticated user’s library.

Returns:

List of Library items as LibraryShortcut objects.

Return type:

list[LibraryShortcut]

publish(contents)

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

contents: dashboards or documents to be published, can be

Dashboard/Document class object or ID

Parameters:

contents (list | Dashboard | Document | str) –

unpublish(contents)

Unpublishes dashboard or document from the authenticated user’s library.

contents: dashboards or documents to be published, can be

Dashboard/Document class object or ID

Parameters:

contents (list | Dashboard | Document | str) –