Skip to content

Application

ApplicationType = namedtuple('ApplicationType', ['value', 'suffix', 'odata_type']) module-attribute

Application(path, name, application_type)

Bases: TM1Object

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, application_type: Union[ApplicationTypes, str]):
    self.path = path
    # remove suffix from name
    if application_type.suffix and name.endswith(application_type.suffix):
        self.name = name[: -len(application_type.suffix)]
    else:
        self.name = name
    # raise ValueError if not a valid type
    self.application_type = ApplicationTypes(application_type)

application_id property

application_type = ApplicationTypes(application_type) instance-attribute

body property

body_as_dict property

name = name[:(-len(application_type.suffix))] instance-attribute

path = path instance-attribute

ApplicationTypes

Bases: Enum

CHORE = ApplicationType(1, '.chore', 'tm1.ChoreReference') class-attribute instance-attribute

CUBE = ApplicationType(2, '.cube', 'tm1.CubeReference') class-attribute instance-attribute

DIMENSION = ApplicationType(3, '.dimension', 'tm1.DimensionReference') class-attribute instance-attribute

DOCUMENT = ApplicationType(4, '.blob', '#ibm.tm1.api.v1.Document') class-attribute instance-attribute

FOLDER = ApplicationType(5, '', '#ibm.tm1.api.v1.Folder') class-attribute instance-attribute

PROCESS = ApplicationType(7, '.process', 'tm1.ProcessReference') class-attribute instance-attribute

SUBSET = ApplicationType(8, '.subset', 'tm1.SubsetReference') class-attribute instance-attribute

VIEW = ApplicationType(9, '.view', 'tm1.ViewReference') class-attribute instance-attribute

odata_type property

suffix property

ChoreApplication(path, name, chore_name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, chore_name: str):
    super().__init__(path, name, ApplicationTypes.CHORE)
    self.chore_name = chore_name

body property

chore_name = chore_name instance-attribute

CubeApplication(path, name, cube_name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, cube_name: str):
    super().__init__(path, name, ApplicationTypes.CUBE)
    self.cube_name = cube_name

body property

cube_name = cube_name instance-attribute

DimensionApplication(path, name, dimension_name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, dimension_name: str):
    super().__init__(path, name, ApplicationTypes.DIMENSION)
    self.dimension_name = dimension_name

body property

dimension_name = dimension_name instance-attribute

DocumentApplication(path, name, content, file_id=None, file_name=None, last_updated=None)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(
    self, path: str, name: str, content: bytes, file_id: str = None, file_name: str = None, last_updated: str = None
):
    super().__init__(path, name, ApplicationTypes.DOCUMENT)
    self.content = content
    # below fields only populated for retrieved applications
    self.file_id = file_id
    self.file_name = file_name
    self.last_updated = last_updated

content = content instance-attribute

file_id = file_id instance-attribute

file_name = file_name instance-attribute

last_updated = last_updated instance-attribute

to_file(path_to_file)

Parameters:

Name Type Description Default
path_to_file str

path to newly to create file including the extension (e.g., xlsx, xlsm)

required

Returns:

Type Description
Source code in TM1py/Objects/Application.py
def to_file(self, path_to_file: str):
    """

    :param path_to_file: path to newly to create file including the extension (e.g., xlsx, xlsm)
    :return:
    """
    with open(path_to_file, "wb") as file:
        file.write(self.content)

to_xlsx(path_to_file)

Source code in TM1py/Objects/Application.py
def to_xlsx(self, path_to_file: str):
    warnings.warn("Function 'to_xlsx' is deprecated. Use 'to_file' instead", DeprecationWarning, stacklevel=2)
    return self.to_file(path_to_file=path_to_file)

FolderApplication(path, name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str):
    super().__init__(path, name, ApplicationTypes.FOLDER)

LinkApplication(path, name, url)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, url: str):
    super().__init__(path, name, ApplicationTypes.LINK)
    self.url = url

body property

url = url instance-attribute

ProcessApplication(path, name, process_name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, process_name: str):
    super().__init__(path, name, ApplicationTypes.PROCESS)
    self.process_name = process_name

body property

process_name = process_name instance-attribute

SubsetApplication(path, name, dimension_name, hierarchy_name, subset_name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, dimension_name: str, hierarchy_name: str, subset_name: str):
    super().__init__(path, name, ApplicationTypes.SUBSET)
    self.dimension_name = dimension_name
    self.hierarchy_name = hierarchy_name
    self.subset_name = subset_name

body property

dimension_name = dimension_name instance-attribute

hierarchy_name = hierarchy_name instance-attribute

subset_name = subset_name instance-attribute

ViewApplication(path, name, cube_name, view_name)

Bases: Application

Source code in TM1py/Objects/Application.py
def __init__(self, path: str, name: str, cube_name: str, view_name: str):
    super().__init__(path, name, ApplicationTypes.VIEW)
    self.cube_name = cube_name
    self.view_name = view_name

body property

cube_name = cube_name instance-attribute

view_name = view_name instance-attribute