0% found this document useful (0 votes)
245 views68 pages

TM1py Documentation Overview

The document summarizes the TM1py module, which provides a Python interface for interacting with TM1 databases. It contains classes for objects like cubes, dimensions, subsets, and processes that simplify working with the TM1 REST API. The module is organized into subpackages for exceptions, objects, services, and utilities.

Uploaded by

pourush gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views68 pages

TM1py Documentation Overview

The document summarizes the TM1py module, which provides a Python interface for interacting with TM1 databases. It contains classes for objects like cubes, dimensions, subsets, and processes that simplify working with the TM1 REST API. The module is organized into subpackages for exceptions, objects, services, and utilities.

Uploaded by

pourush gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TM1py Documentation

Release 1.0.2

Marius Wirtz, Cubewise CODE

Mar 24, 2019


Contents

1 Module contents 1

2 Subpackages 3
2.1 [Link] package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 [Link] package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 [Link] package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 [Link] package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Python Module Index 51

i
ii
CHAPTER 1

Module contents

A python module for TM1.


[Link]
TM1py wraps the TM1 REST API into concise Python classes and Services that simplify TM1 interactions from
python.
Usage: >>> with RESTService(address=’‘, port=8001, user=’admin’, password=’apple’, ssl=False) as tm1_rest: >>>
subset_service = SubsetService(tm1_rest) >>> subset = Subset(dimension_name=’Month’, subset_name=’Q1’, ele-
ments=[‘Jan’, ‘Feb’, ‘Mar’]) >>> subset_service.create(subset, private=True)

1
TM1py Documentation, Release 1.0.2

2 Chapter 1. Module contents


CHAPTER 2

Subpackages

2.1 [Link] package

2.1.1 Submodules

2.1.2 [Link] module

exception [Link].TM1pyException(response, status_code, reason)


Bases: [Link]
The default exception for TM1py
reason
response
status_code

3
TM1py Documentation, Release 1.0.2

2.1.3 Module contents

2.2 [Link] package

2.2.1 Submodules

2.2.2 [Link] module

class [Link](comment_value, object_name,


dimensional_context, com-
ment_type=’ANNOTATION’, annota-
tion_id=None, text=”, creator=None,
created=None, last_updated_by=None,
last_updated=None)
Bases: [Link].TM1Object.TM1Object
Abtraction of TM1 Annotation
Notes
• Class complete, functional and tested.
• doesn’t cover Attachments though
body
comment_value
created
dimensional_context
classmethod from_json(annotation_as_json)
Alternative constructor
Parameters annotation_as_json – String, JSON
Returns instance of [Link]
id
last_updated
last_updated_by
move(dimension_order, dimension, target_element, source_element=None)
Move annotation on given dimension from source_element to target_element
Parameters
• dimension_order – List, order of the dimensions in the cube
• dimension – dimension name
• target_element – target element name
• source_element – source element name
Returns
object_name
text

4 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

2.2.3 [Link] module

class [Link](path, content)


Bases: [Link].TM1Object.TM1Object
to_xlsx(path_to_file)

2.2.4 [Link] module

class [Link](dimension_name, subset)


Bases: [Link].TM1Object.TM1Object
Describes what is selected in a dimension on an axis. Can be a Registered Subset or an Anonymous Subset
body
body_as_dict
dimension_name
hierarchy_name
subset
class [Link](dimension_name, subset, selected)
Describes what is selected in a dimension on the view title. Can be a Registered Subset or an Anonymous Subset

body
dimension_name
hierarchy_name
selected
subset

2.2.5 [Link] module

class [Link](name, start_time, dst_sensitivity, active, execution_mode, fre-


quency, tasks)
Bases: [Link].TM1Object.TM1Object
Abstraction of TM1 Chore
activate()
active
add_task(task)
body
body_as_dict
construct_body()
construct [Link] (json) from the class attributes :return: String, TM1 JSON representation of a chore
deactivate()
dst_sensitivity
execution_mode

2.2. [Link] package 5


TM1py Documentation, Release 1.0.2

frequency
classmethod from_dict(chore_as_dict)
Alternative constructor
Parameters chore_as_dict – Chore as dict
Returns Chore, an instance of this class
classmethod from_json(chore_as_json)
Alternative constructor
Parameters chore_as_json – string, JSON. Response of
/api/v1/Chores(‘x’)/Tasks?$expand=*
Returns Chore, an instance of this class
name
reschedule(days=0, hours=0, minutes=0, seconds=0)
start_time
tasks

2.2.6 [Link] module

class [Link](days, hours, minutes, seconds)


Bases: [Link].TM1Object.TM1Object
Utility class to handle time representation fore Chore Frequency
days
frequency_string
classmethod from_string(frequency_string)
hours
minutes
seconds

2.2.7 [Link] module

class [Link](year, month, day, hour, minute, sec-


ond)
Bases: [Link].TM1Object.TM1Object
Utility class to handle time representation for Chore Start Time
add(days=0, hours=0, minutes=0, seconds=0)
classmethod from_string(start_time_string)
set_time(year=None, month=None, day=None, hour=None, minute=None, second=None)
start_time_string
substract(days=0, hours=0, minutes=0, seconds=0)

6 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

2.2.8 [Link] module

class [Link](step, process_name, parameters)


Bases: [Link].TM1Object.TM1Object
Abstraction of a Chore Task
A Chore task always conistst of - The step integer ID: it’s order in the execution plan.
1 to n, where n is the last Process in the Chore

• The name of the process to execute


• The parameters for the process

body
body_as_dict
classmethod from_dict(chore_task_as_dict)
parameters
process_name
step

2.2.9 [Link] module

class [Link](name, dimensions, rules=None)


Bases: [Link].TM1Object.TM1Object
Abstraction of a TM1 Cube
body
dimensions
feedstrings
classmethod from_dict(cube_as_dict)
Alternative constructor
Parameters cube_as_dict – user as dict
Returns user, an instance of this class
classmethod from_json(cube_as_json)
Alternative constructor
Parameters cube_as_json – user as JSON string
Returns cube, an instance of this class
has_rules
name
rules
skipcheck
undefvals

2.2. [Link] package 7


TM1py Documentation, Release 1.0.2

2.2.10 [Link] module

class [Link](name, hierarchies=None)


Bases: [Link].TM1Object.TM1Object
Abstraction of TM1 Dimension
A Dimension is a container for hierarchies.
add_hierarchy(hierarchy)
body
body_as_dict
contains_hierarchy(hierarchy_name)
default_hierarchy
classmethod from_dict(dimension_as_dict)
classmethod from_json(dimension_as_json)
get_hierarchy(hierarchy_name)
hierarchies
hierarchy_names
name
remove_hierarchy(hierarchy_name)
unique_name

2.2.11 [Link] module

class [Link](name, element_type, attributes=None,


unique_name=None, index=None)
Bases: [Link].TM1Object.TM1Object
Abstraction of TM1 Element
body
body_as_dict
element_attributes
element_type
static from_dict(element_as_dict)
index
name
unique_name
valid_types = ('Numeric', 'String', 'Consolidated')

8 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

2.2.12 [Link] module

class [Link](name, attribute_type)


Bases: [Link].TM1Object.TM1Object
Abstraction of TM1 Element Attributes
attribute_type
body
body_as_dict
classmethod from_dict(element_attribute_as_dict)
classmethod from_json(element_attribute_as_json)
name
valid_types = ['NUMERIC', 'STRING', 'ALIAS']

2.2.13 [Link] module

class [Link](name, dimension_name, elements=None,


element_attributes=None, edges=None,
subsets=None, structure=None, de-
fault_member=None)
Bases: [Link].TM1Object.TM1Object
Abstraction of TM1 Hierarchy Requires reference to a Dimension
Elements modeled as a Dictionary where key is the element name and value an instance of [Link] {
‘US’: instance of [Link], ‘CN’: instance of [Link], ‘AU’: instance of
[Link]
}
ElementAttributes of type [Link]
Edges are represented as a [Link]: {
(parent1, component1) : 10, (parent1, component2) : 30
}
Subsets is list of type [Link]
add_edge(parent, component, weight)
add_element(element_name, element_type)
add_element_attribute(name, attribute_type)
balanced
body
body_as_dict
contains_element(element_name)
default_member
dimension_name
edges

2.2. [Link] package 9


TM1py Documentation, Release 1.0.2

element_attributes
elements
classmethod from_dict(hierarchy_as_dict)
get_element(element_name)
name
remove_edge(parent, component)
remove_edges(edges)
remove_edges_related_to_element(element_name)
remove_element(element_name)
remove_element_attribute(name)
subsets
update_edge(parent, component, weight)
update_element(element_name, element_type=None)

2.2.14 [Link] module

class [Link](cube_name, view_name, MDX)


Bases: [Link]
Abstraction on TM1 MDX view
IMPORTANT. MDXViews can’t be seen through the old TM1 clients (Archict, Perspectives). They do exist
though!
MDX
body
construct_body()
classmethod from_dict(view_as_dict, cube_name=None)
classmethod from_json(view_as_json, cube_name=None)

2.2.15 [Link] module

class [Link](cube_name, view_name, sup-


press_empty_columns=False, sup-
press_empty_rows=False, for-
mat_string=’0.#########’, titles=None,
columns=None, rows=None)
Bases: [Link]
Abstraction of TM1 NativeView (classic cube view)
Notes Complete, functional and tested
MDX
add_column(dimension_name, subset=None)
Add Dimension or Subset to the column-axis

10 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Parameters
• dimension_name – name of the dimension
• subset – instance of [Link]. Can be None instead.
Returns
add_row(dimension_name, subset=None)
Add Dimension or Subset to the row-axis
Parameters
• dimension_name –
• subset – instance of [Link]. Can be None instead.
Returns
add_title(dimension_name, selection, subset=None)
Add subset and element to the titles-axis
Parameters
• dimension_name – name of the dimension.
• selection – name of an element.
• subset – instance of [Link]. Can be None instead.
Returns
as_MDX
Build a valid MDX Query from an Existing cubeview. Takes Zero suppression into account. Throws an
Exception when no elements are place on the columns. Subsets are referenced in the result-MDX through
the TM1SubsetToSet Function
Returns String, the MDX Query
body
columns
format_string
classmethod from_dict(view_as_dict, cube_name=None)
classmethod from_json(view_as_json, cube_name=None)
Alternative constructor :Parameters:
view_as_json : string, JSON

Returns View : an instance of this class

remove_column(dimension_name)
remove dimension from the column axis
Parameters dimension_name –
Returns
remove_row(dimension_name)
remove dimension from the row axis
Parameters dimension_name –
Returns

2.2. [Link] package 11


TM1py Documentation, Release 1.0.2

remove_title(dimension_name)
remove dimension from the titles-axis
Parameters dimension_name – name of the dimension.
Returns
rows
suppress_empty_cells
suppress_empty_columns
suppress_empty_rows

2.2.16 [Link] module

class [Link](name, has_security_access=False,


ui_data=’CubeAction=1511xe2x82xacDataAction=1503xe2x82xacCubeLogChan
parameters=None, variables=None, vari-
ables_ui_data=None, prolog_procedure=”, meta-
data_procedure=”, data_procedure=”, epi-
log_procedure=”, datasource_type=’None’,
datasource_ascii_decimal_separator=’.’,
datasource_ascii_delimiter_char=’;’, data-
source_ascii_delimiter_type=’Character’,
datasource_ascii_header_records=1, data-
source_ascii_quote_character=”, data-
source_ascii_thousand_separator=’, ’, data-
source_data_source_name_for_client=”, data-
source_data_source_name_for_server=”, data-
source_password=”, datasource_user_name=”, data-
source_query=”, datasource_uses_unicode=True,
datasource_view=”, datasource_subset=”)
Bases: [Link].TM1Object.TM1Object
Abstraction of a TM1 Process.
IMPORTANT. doesn’t work with Processes that were generated through the Wizard
static add_generated_string_to_code(code)
add_parameter(name, prompt, value, parameter_type=None)
Parameters
• name –
• prompt –
• value –
• parameter_type – introduced in TM1 11 REST API, therefor optional. if Not given
type is derived from value
Returns
add_variable(name, type)
add variable to the process
Parameters
• name –

12 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2


• type – ‘String’ or ‘Numeric’
Returns
auto_generated_string = '#****Begin: Generated Statements***\r\n#****End: Generated S
begin_generated_statements = '#****Begin: Generated Statements***'
body
data_procedure
datasource_ascii_decimal_separator
datasource_ascii_delimiter_char
datasource_ascii_delimiter_type
datasource_ascii_header_records
datasource_ascii_quote_character
datasource_ascii_thousand_separator
datasource_data_source_name_for_client
datasource_data_source_name_for_server
datasource_password
datasource_query
datasource_subset
datasource_type
datasource_user_name
datasource_uses_unicode
datasource_view
drop_parameter_types()
end_generated_statements = '#****End: Generated Statements****'
epilog_procedure
classmethod from_dict(process_as_dict)
Parameters process_as_dict – Dictionary, process as dictionary
Returns an instance of this class
classmethod from_json(process_as_json)
Parameters process_as_json – response of /api/v1/Processes(‘x’)?$expand=*
Returns an instance of this class
has_security_access
metadata_procedure
name
parameters
prolog_procedure

2.2. [Link] package 13


TM1py Documentation, Release 1.0.2

remove_parameter(name)
remove_variable(name)
variables

2.2.17 [Link] module

class [Link](rules)
Bases: [Link].TM1Object.TM1Object
Abstraction of Rules on a cube.
rules_analytics A collection of rulestatements, where each statement is stored in uppercase without linebreaks.
comments are not included.
feeder_statements
feedstrings
has_feeders
init_analytics()
keywords = ['SKIPCHECK', 'FEEDSTRINGS', 'UNDEFVALS', 'FEEDERS']
rule_statements
rules_analytics
skipcheck
text
undefvals

2.2.18 [Link] module

class [Link](server_as_dict)
Abstraction of the TM1 Server
Notes contains the information you get from [Link] no methods so far

2.2.19 [Link] module

class [Link](dimension_name, hierarchy_name=None, ex-


pression=None, elements=None)
Bases: [Link]
Abstraction of unregistered Subsets used in NativeViews (Check [Link])
classmethod from_dict(subset_as_dict)
Alternative constructor
Parameters subset_as_dict – dictionary, representation of Subset as specified in CSDL
Returns an instance of this class
classmethod from_json(subset_as_json)
Alternative constructor :Parameters:
subset_as_json [string, JSON] representation of Subset as specified in CSDL

14 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Returns Subset : an instance of this class

class [Link](subset_name, dimension_name, hierarchy_name=None,


alias=None, expression=None, elements=None)
Bases: [Link].TM1Object.TM1Object
Abstraction of the TM1 Subset (dynamic and static)
Done and tested. unittests available.
add_elements(elements)
add Elements to static subsets :Parameters:
elements : list of element names
alias
body
same logic here as in TM1 : when subset has expression its dynamic, otherwise static
body_as_dict
same logic here as in TM1 : when subset has expression its dynamic, otherwise static
dimension_name
elements
expression
classmethod from_dict(subset_as_dict)
classmethod from_json(subset_as_json)
Alternative constructor :Parameters:
subset_as_json [string, JSON] representation of Subset as specified in CSDL

Returns Subset : an instance of this class

hierarchy_name
is_dynamic
is_static
name
type

2.2.20 [Link].TM1Object module

class [Link].TM1Object.TM1Object
Parent Class for all TM1 Objects e.g. Cube, Process, Dimension.
body

2.2.21 [Link] module

class [Link](name, groups, friendly_name=None, password=None)


Bases: [Link].TM1Object.TM1Object
Abstraction of a TM1 User

2.2. [Link] package 15


TM1py Documentation, Release 1.0.2

add_group(group_name)
body
construct_body()
construct body (json) from the class attributes :return: String, TM1 JSON representation of a user
friendly_name
classmethod from_dict(user_as_dict)
Alternative constructor
Parameters user_as_dict – user as dict
Returns user, an instance of this class
classmethod from_json(user_as_json)
Alternative constructor
Parameters user_as_json – user as JSON string
Returns user, an instance of this class
groups
is_admin
name
password
remove_group(group_name)

2.2.22 [Link] module

class [Link](cube, name)


Bases: [Link].TM1Object.TM1Object
Abstraction of TM1 View serves as a parentclass for [Link] and
[Link]
cube
name

2.2.23 Module contents

2.3 [Link] package

2.3.1 Submodules

2.3.2 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TM1 CellAnnotations
create(annotation)
create an Annotation

16 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Parameters annotation – instance of [Link]


:return response
delete(annotation_id)
delete Annotation on TM1 Server
Parameters annotation_id – string, the id of the annotation
Returns string: the response
get(annotation_id)
get an annotation from any cube in TM1 Server through its id
Parameters annotation_id – String, the id of the annotation
Returns Annotation: an instance of [Link]
get_all(cube_name)
get all annotations from given cube as a List.
Parameters cube_name –
Returns list of instances of [Link]
update(annotation)
update Annotation on TM1 Server
Parameters annotation – instance of [Link]
Notes
updateable attributes: commentValue

2.3.3 [Link] module

class [Link](tm1_rest)
Service to Read and Write TM1 Applications
get(path)
Get Excel Application from TM1 Server in binary format. Can be dumped to file.
Parameters path – path through folder structur to application. For instance: “Fi-
nance/P&[Link]”
Returns
Return application as binary. Can be dumped to file: with open(“[Link]”, “wb”) as out:
[Link](content)

2.3.4 [Link] module

class [Link](tm1_rest)
Service to handle Read and Write operations to TM1 cubes
activate_transactionlog(*args)
Activate Transactionlog for one or many cubes
Parameters args – one or many cube names
Returns

2.3. [Link] package 17


TM1py Documentation, Release 1.0.2

create_cellset(mdx)
Execute MDX in order to create cellset at server. return the cellset-id
Parameters mdx – MDX Query, as string
Returns
create_cellset_from_view(cube_name, view_name, private)
deactivate_transactionlog(*args)
Deacctivate Transactionlog for one or many cubes
Parameters args – one or many cube names
Returns
delete_cellset(cellset_id)
Delete a cellset
Parameters cellset_id –
Returns
execute_mdx(mdx, cell_properties=None, top=None, skip_contexts=False)
Execute MDX and return the cells with their properties
Parameters
• mdx – MDX Query, as string
• cell_properties – properties to be queried from the cell. E.g. Value, Ordinal,
RuleDerived, . . .
• top – integer
• skip_contexts – skip elements from titles / contexts in response
Returns content in sweet concise structure.
execute_mdx_cellcount(mdx)
Execute MDX in order to understand how many cells are in a cellset. Only return number of cells in the
cellset. FAST!
Parameters mdx – MDX Query, as string
Returns Number of Cells in the CellSet
execute_mdx_csv(mdx)
Optimized for performance. Get csv string of coordinates and values. Context dimensions are omitted !
Cells with Zero/null are omitted !
Parameters mdx – Valid MDX Query
Returns String
execute_mdx_dataframe(mdx)
Optimized for performance. Get Pandas DataFrame from MDX Query. Context dimensions are omitted in
the resulting Dataframe ! Cells with Zero/null are omitted !
Parameters mdx – Valid MDX Query
Returns Pandas Dataframe
execute_mdx_dataframe_pivot(mdx, dropna=False, fill_value=None)
Execute MDX Query to get a pandas pivot dataframe in the shape as specified in the Query
Parameters

18 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

• mdx –
• dropna –
• fill_value –
Returns
execute_mdx_raw(mdx, cell_properties=None, elem_properties=None, member_properties=None,
top=None, skip_contexts=False)
Execute MDX and return the raw data from TM1
Parameters
• mdx – String, a valid MDX Query
• cell_properties – List of properties to be queried from the cell. E.g. [‘Value’,
‘Ordinal’, ‘RuleDerived’, . . . ]
• elem_properties – List of properties to be queried from the elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]
• member_properties – List of properties to be queried from the members. E.g.
[‘UniqueName’,’Attributes’, . . . ]
• top – Integer limiting the number of cells and the number or rows returned
• skip_contexts – skip elements from titles / contexts in response
Returns Raw format from TM1.
execute_mdx_rows_and_values(mdx, element_unique_names=True)
execute_mdx_ui_array(mdx, elem_properties=None, member_properties=None,
value_precision=2, top=None)
Useful for grids or charting libraries that want an array of cell values per row. Returns 3-dimensional cell
structure for tabbed grids or multiple charts. Rows and pages are dicts, addressable by their name. Proper
order of rows can be obtained in headers[1] Example ‘cells’ return format:
‘cells’: {
‘10100’: {
‘Net Operating Income’: [ 19832724.72429739, 20365654.788303416,
20729201.329183243, 20480205.20121749],
‘Revenue’: [ 28981046.50724231, 29512482.207418434, 29913730.038971487,
29563345.9542385]},
‘10200’: {
‘Net Operating Income’: [ 9853293.623709997, 10277650.763958748,
10466934.096533755, 10333095.839474997],
‘Revenue’: [ 13888143.710000003, 14300216.43, 14502421.63,
14321501.940000001]}
},

Parameters
• top –
• mdx – a valid MDX Query
• elem_properties – List of properties to be queried from the elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]

2.3. [Link] package 19


TM1py Documentation, Release 1.0.2

• member_properties – List of properties to be queried from the members. E.g.


[‘UniqueName’,’Attributes’, . . . ]
• value_precision – Integer (optional) specifying number of decimal places to return
Returns dict : { titles: [], headers: [axis][], cells: { Page0: { Row0: { [row values], Row1: [],
. . . }, . . . }, . . . } }

execute_mdx_ui_dygraph(mdx, elem_properties=None, member_properties=None,


value_precision=2, top=None)
Execute MDX get dygraph dictionary Useful for grids or charting libraries that want an array of cell values
per column Returns 3-dimensional cell structure for tabbed grids or multiple charts Example ‘cells’ return
format:
‘cells’: {
‘10100’: [ [‘Q1-2004’, 28981046.50724231, 19832724.72429739], [‘Q2-2004’,
29512482.207418434, 20365654.788303416], [‘Q3-2004’, 29913730.038971487,
20729201.329183243], [‘Q4-2004’, 29563345.9542385, 20480205.20121749]],
‘10200’: [ [‘Q1-2004’, 13888143.710000003, 9853293.623709997], [‘Q2-2004’,
14300216.43, 10277650.763958748], [‘Q3-2004’, 14502421.63, 10466934.096533755],
[‘Q4-2004’, 14321501.940000001, 10333095.839474997]]
},

Parameters
• top –
• mdx – String, valid MDX Query
• elem_properties – List of properties to be queried from the elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]
• member_properties – List of properties to be queried from the members. E.g.
[‘UniqueName’,’Attributes’, . . . ]
• value_precision – Integer (optional) specifying number of decimal places to return
Returns dict : { titles: [], headers: [axis][], cells: { Page0: [ [column name, column values], [],
. . . ], . . . } }

execute_mdx_values(mdx)
Optimized for performance. Query only raw cell values. Coordinates are omitted !
Parameters mdx – a valid MDX Query
Returns Generator of cell values
execute_view(cube_name, view_name, cell_properties=None, private=True, top=None,
skip_contexts=False)
get view content as dictionary with sweet and concise structure. Works on NativeView and
MDXView !

Parameters
• cube_name – String
• view_name – String
• cell_properties – List, cell properties: [Values, Status, HasPicklist, etc.]

20 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

• private – Boolean
• top – Int, number of cells to return (counting from top)
• skip_contexts – skip elements from titles / contexts in response
Returns Dictionary : {([dim1].[elem1], [dim2][elem6]): {‘Value’:3127.312, ‘Ordinal’:12} . . . .
}

execute_view_cellcount(cube_name, view_name, private=True)


Execute cube view in order to understand how many cells are in a cellset. Only return number of cells in
the cellset. FAST!
Parameters
• cube_name – cube name
• view_name – view name
• private – True (private) or False (public)
Returns
execute_view_csv(cube_name, view_name, private=True)
execute_view_dataframe(cube_name, view_name, private=True)
Optimized for performance. Get Pandas DataFrame from an existing Cube View Context dimensions are
omitted in the resulting Dataframe ! Cells with Zero/null are omitted !
Parameters
• cube_name – Name of the
• view_name –
• private –
Returns
execute_view_dataframe_pivot(cube_name, view_name, private=False, dropna=False,
fill_value=None)
Execute a cube view to get a pandas pivot dataframe, in the shape of the cube view
Parameters
• cube_name –
• view_name –
• private –
• dropna –
• fill_value –
Returns
execute_view_raw(cube_name, view_name, private=True, cell_properties=None,
elem_properties=None, member_properties=None, top=None,
skip_contexts=False)
Execute a cube view and return the raw data from TM1
Parameters
• cube_name – String, name of the cube
• view_name – String, name of the view

2.3. [Link] package 21


TM1py Documentation, Release 1.0.2

• private – True (private) or False (public)


• cell_properties – List of properties to be queried from the cell. E.g. [‘Value’,
‘Ordinal’, ‘RuleDerived’, . . . ]
• elem_properties – List of properties to be queried from the elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]
• member_properties – List of properties to be queried from the members. E.g.
[‘UniqueName’,’Attributes’, . . . ]
• top – Integer limiting the number of cells and the number or rows returned
• skip_contexts – skip elements from titles / contexts in response
Returns Raw format from TM1.
execute_view_rows_and_values(cube_name, view_name, private=True, ele-
ment_unique_names=True)
execute_view_ui_array(cube_name, view_name, private=True, elem_properties=None, mem-
ber_properties=None, value_precision=2, top=None)
Useful for grids or charting libraries that want an array of cell values per row. Returns 3-dimensional cell
structure for tabbed grids or multiple charts. Rows and pages are dicts, addressable by their name. Proper
order of rows can be obtained in headers[1] Example ‘cells’ return format:
‘cells’: {
‘10100’: {
‘Net Operating Income’: [ 19832724.72429739, 20365654.788303416,
20729201.329183243, 20480205.20121749],
‘Revenue’: [ 28981046.50724231, 29512482.207418434, 29913730.038971487,
29563345.9542385]},
‘10200’: {
‘Net Operating Income’: [ 9853293.623709997, 10277650.763958748,
10466934.096533755, 10333095.839474997],
‘Revenue’: [ 13888143.710000003, 14300216.43, 14502421.63,
14321501.940000001]}
},

Parameters
• top –
• cube_name – cube name
• view_name – view name
• private – True (private) or False (public)
• elem_properties – List of properties to be queried from the elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]
• member_properties – List properties to be queried from the member. E.g. [‘Name’,
‘UniqueName’]
• value_precision – Integer (optional) specifying number of decimal places to return
Returns dict : { titles: [], headers: [axis][], cells: { Page0: { Row0: { [row values], Row1: [],
. . . }, . . . }, . . . } }

22 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

execute_view_ui_dygraph(cube_name, view_name, private=True, elem_properties=None, mem-


ber_properties=None, value_precision=2, top=None)
Useful for grids or charting libraries that want an array of cell values per row. Returns 3-dimensional cell
structure for tabbed grids or multiple charts. Rows and pages are dicts, addressable by their name. Proper
order of rows can be obtained in headers[1] Example ‘cells’ return format:
‘cells’: {
‘10100’: {
‘Net Operating Income’: [ 19832724.72429739, 20365654.788303416,
20729201.329183243, 20480205.20121749],
‘Revenue’: [ 28981046.50724231, 29512482.207418434, 29913730.038971487,
29563345.9542385]},
‘10200’: {
‘Net Operating Income’: [ 9853293.623709997, 10277650.763958748,
10466934.096533755, 10333095.839474997],
‘Revenue’: [ 13888143.710000003, 14300216.43, 14502421.63,
14321501.940000001]}
},

Parameters
• top –
• cube_name – cube name
• view_name – view name
• private – True (private) or False (public)
• elem_properties – List of properties to be queried from the elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]
• member_properties – List of properties to be queried from the members. E.g.
[‘UniqueName’,’Attributes’, . . . ]
• value_precision – number decimals
Returns

execute_view_values(cube_name, view_name, private=True)


extract_cellset(cellset_id, cell_properties=None, top=None, delete_cellset=True,
skip_contexts=False)
Execute Cellset and return the cells with their properties
Parameters
• skip_contexts –
• delete_cellset –
• cellset_id –
• cell_properties – properties to be queried from the cell. E.g. Value, Ordinal,
RuleDerived, . . .
• top – integer
Returns Content in sweet consice strcuture.

2.3. [Link] package 23


TM1py Documentation, Release 1.0.2

extract_cellset_cellcount(cellset_id, *args, **kwargs)


extract_cellset_composition(cellset_id, *args, **kwargs)
extract_cellset_csv(cellset_id, *args, **kwargs)
Execute Cellset and return only the ‘Content’, in csv format
Parameters cellset_id – String; ID of existing cellset
Returns Raw format from TM1.
extract_cellset_dataframe_pivot(cellset_id, dropna=False, fill_value=False, **kwargs)
Extract a pivot table (pandas dataframe) from a cellset in TM1
Parameters
• cellset_id –
• dropna –
• fill_value –
• kwargs –
Returns
extract_cellset_raw(cellset_id, *args, **kwargs)
Extract full Cellset data and return the raw data from TM1
Parameters
• skip_contexts –
• cellset_id – String; ID of existing cellset
• cell_properties – List of properties to be queried from cells. E.g. [‘Value’, ‘RuleD-
erived’, . . . ]
• elem_properties – List of properties to be queried from elements. E.g. [‘Unique-
Name’,’Attributes’, . . . ]
• member_properties – List properties to be queried from the member. E.g. [‘Name’,
‘UniqueName’]
• top – Integer limiting the number of cells and the number or rows returned
Returns Raw format from TM1.
extract_cellset_rows_and_values(cellset_id, *args, **kwargs)
extract_cellset_values(cellset_id, *args, **kwargs)
Extract Cellset data and return only the cells and values
Parameters cellset_id – String; ID of existing cellset
Returns Raw format from TM1.
get_cellset_cells_count(mdx)
Execute MDX in order to understand how many cells are in a cellset
Parameters mdx – MDX Query, as string
Returns Number of Cells in the CellSet
get_value(cube_name, element_string, dimensions=None)
Element_String describes the Dimension-Hierarchy-Element arrangement
Parameters

24 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

• cube_name – Name of the cube


• element_string – “Hierarchy1::Element1 && Hierarchy2::Element4, Element9, El-
ement2” - Dimensions are not specified! They are derived from the position. - The ,
seperates the element-selections - If more than one hierarchy is selected per dimension
&& splits the elementselections - If no Hierarchy is specified. Default Hierarchy will be
addressed
• dimensions – List of dimension names in correct order
Returns
get_view_content(cube_name, view_name, cell_properties=None, private=True, top=None)
relative_proportional_spread(value, cube, unique_element_names, refer-
ence_unique_element_names, reference_cube=None)
Execute relative proportional spread
Parameters
• value – value to be spread
• cube – name of the cube
• unique_element_names – target cell coordinates as unique element names (e.g.
[“[d1].[c1]”,”[d2].[e3]”])
• reference_cube – name of the reference cube. Can be None
• reference_unique_element_names – reference cell coordinates as unique ele-
ment names
Returns
update_cellset(cellset_id, *args, **kwargs)
Write values into cellset
Number of values must match the number of cells in the cellset
Parameters
• cellset_id –
• values – iterable with Numeric and String values
Returns
write_value(value, cube_name, element_tuple, dimensions=None)
Write value into cube at specified coordinates
Parameters
• value – the actual value
• cube_name – name of the target cube
• element_tuple – target coordinates
• dimensions – optional. Dimension names in their natural order. Will speed up the
execution!
Returns response
write_values(cube_name, cellset_as_dict, dimensions=None)
Write values in cube. For cellsets with > 1000 cells look into “write_values_through_cellset”
Parameters

2.3. [Link] package 25


TM1py Documentation, Release 1.0.2

• cube_name – name of the cube


• cellset_as_dict – {(elem_a, elem_b, elem_c): 243, (elem_d, elem_e, elem_f) :
109}
• dimensions – optional. Dimension names in their natural order. Will speed up the
execution!
Returns Response
write_values_through_cellset(mdx, values)
Significantly faster than write_values function Cellset gets created according to MDX Expression. For
instance: [[61, 29 ,13], [42, 54, 15], [17, 28, 81]]
Each value in the cellset can be addressed through its position: The ordinal integer value. Ordinal-
enumeration goes from top to bottom from left to right Number 61 has Ordinal 0, 29 has Ordinal 1,
etc.
The order of the iterable determines the insertion point in the cellset. For instance: [91, 85, 72, 68, 51, 42,
35, 28, 11]
would lead to: [[91, 85 ,72], [68, 51, 42], [35, 28, 11]]
When writing large datasets into TM1 Cubes it can be convenient to call this function asynchronously.
Parameters
• mdx – Valid MDX Expression.
• values – List of values. The Order of the List/ Iterable determines the insertion point in
the cellset.
Returns
[Link].tidy_cellset(func)
Higher Order Function to tidy up cellset after usage

2.3.5 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TM1 Chores
activate(chore_name)
activate chore on TM1 Server
Parameters chore_name –
Returns response
create(chore)
create chore in TM1
Parameters chore – instance of [Link]
Returns
deactivate(chore_name)
deactivate chore on TM1 Server
Parameters chore_name –
Returns response

26 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

delete(chore_name)
delete chore in TM1
Parameters chore_name –
Returns response
execute_chore(chore_name)
Ask TM1 Server to execute a chore
Parameters chore_name – String, name of the chore to be executed
Returns the response
exists(chore_name)
Check if Chore exists
Parameters chore_name –
Returns
get(chore_name)
Get a chore from the TM1 Server
Parameters chore_name –
Returns instance of [Link]
get_all()
get a List of all Chores
Returns List of [Link]
get_all_names()
get a List of all Chores
Returns List of [Link]
set_local_start_time(chore_name, date_time)
Makes Server crash if chore is activate (10.2.2 FP6) :)
Parameters
• chore_name –
• date_time –
Returns
update(chore)
update chore on TM1 Server
does not update: DST Sensitivity! :param chore: :return: response
[Link].deactivate_activate(func)
Higher Order function to handle activation and deactivation of chores before updating them
Parameters func –
Returns

2.3.6 [Link] module

class [Link](rest)
Bases: [Link]

2.3. [Link] package 27


TM1py Documentation, Release 1.0.2

Service to handle Object Updates for TM1 Cubes


create(cube)
create new cube on TM1 Server
Parameters cube – instance of [Link]
Returns response
delete(cube_name)
Delete a cube in TM1
Parameters cube_name –
Returns response
exists(cube_name)
Check if a cube exists. Return boolean.
Parameters cube_name –
Returns Boolean
get(cube_name)
get cube from TM1 Server
Parameters cube_name –
Returns instance of [Link]
get_all()
get all cubes from TM1 Server as [Link] instances
Returns List of [Link] instances
get_all_names()
Ask TM1 Server for list of all cube names
Returns List of Strings
get_control_cubes()
Get all Cubes with } prefix from TM1 Server as [Link] instances
Returns List of [Link] instances
get_dimension_names(cube_name)
get name of the dimensions of a cube in their correct order
Parameters cube_name – String
Returns List : [dim1, dim2, dim3, etc.]
get_model_cubes()
Get all Cubes without } prefix from TM1 Server as [Link] instances
Returns List of [Link] instances
get_random_intersection(cube_name, unique_names=False)
Get a random Intersection in a cube used mostly for regressiontesting. Not optimized, in terms of perfor-
mance. Function Loads ALL elements for EACH dim. . .
Parameters
• cube_name –
• unique_names – unique names instead of plain element names
Returns List of elements

28 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

get_storage_dimension_order(cube_name)
Get the storage dimension order of a cube
Parameters cube_name –
Returns List of dimension names
update(cube)
Update existing cube on TM1 Server
Parameters cube – instance of [Link]
Returns response
update_storage_dimension_order(cube_name, dimension_names)
Update the storage dimension order of a cube
Parameters
• cube_name –
• dimension_names –
Returns

2.3.7 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TM1 Dimensions
create(dimension)
Create a dimension
Parameters dimension – instance of [Link]
Returns response
create_element_attributes_through_ti(dimension)
:param dimension. Instance of [Link] class :return:
delete(dimension_name)
Delete a dimension
Parameters dimension_name – Name of the dimension
Returns
execute_mdx(dimension_name, mdx)
Execute MDX against Dimension. Requires }ElementAttributes_ Cube of the dimension to exist !
Parameters
• dimension_name – Name of the Dimension
• mdx – valid Dimension-MDX Statement
Returns List of Element names
exists(dimension_name)
Check if dimension exists
Returns

2.3. [Link] package 29


TM1py Documentation, Release 1.0.2

get(dimension_name)
Get a Dimension
Parameters dimension_name –
Returns
get_all_names()
Ask TM1 Server for list with all dimension names
Returns List of Strings
update(dimension)
Update an existing dimension
Parameters dimension – instance of [Link]
Returns None

2.3.8 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TM1 Dimension (resp. Hierarchy) Elements
create(dimension_name, hierarchy_name, element)
create_element_attribute(dimension_name, hierarchy_name, element_attribute)
like AttrInsert
Parameters
• dimension_name –
• hierarchy_name –
• element_attribute – instance of [Link]
Returns
delete(dimension_name, hierarchy_name, element_name)
delete_element_attribute(dimension_name, hierarchy_name, element_attribute)
like AttrDelete
Parameters
• dimension_name –
• hierarchy_name –
• element_attribute – instance of [Link]
Returns
exists(dimension_name, hierarchy_name, element_name)
get(dimension_name, hierarchy_name, element_name)
get_element_attributes(dimension_name, hierarchy_name)
Get element attributes from hierarchy
Parameters
• dimension_name –

30 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

• hierarchy_name –
Returns
get_element_names(dimension_name, hierarchy_name)
Get all elementnames
Parameters
• dimension_name –
• hierarchy_name –
Returns Generator of element-names
get_elements(dimension_name, hierarchy_name)
get_elements_filtered_by_attribute(dimension_name, hierarchy_name, attribute_name,
attribute_value)
Get all elements from a hierarchy with given attribute value
Parameters
• dimension_name –
• hierarchy_name –
• attribute_name –
• attribute_value –
Returns List of element names
get_leaf_element_names(dimension_name, hierarchy_name)
get_leaf_elements(dimension_name, hierarchy_name)
get_leaves_under_consolidation(dimension_name, hierarchy_name, consolidation,
max_depth=None)
Get all leaves under a consolidated element
Parameters
• dimension_name – name of dimension
• hierarchy_name – name of hierarchy
• consolidation – name of consolidated Element
• max_depth – 99 if not passed
Returns
get_members_under_consolidation(dimension_name, hierarchy_name, consolidation,
max_depth=None, leaves_only=False)
Get all members under a consolidated element
Parameters
• dimension_name – name of dimension
• hierarchy_name – name of hierarchy
• consolidation – name of consolidated Element
• max_depth – 99 if not passed
• leaves_only – Only Leaf Elements or all Elements
Returns

2.3. [Link] package 31


TM1py Documentation, Release 1.0.2

update(dimension_name, hierarchy_name, element)

2.3.9 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TM1 Hierarchies
EDGES_WORKAROUND_VERSIONS = ('11.0.002', '11.0.003', '11.1.000')
create(hierarchy)
Create a hierarchy in an existing dimension
Parameters hierarchy –
Returns
delete(dimension_name, hierarchy_name)
exists(dimension_name, hierarchy_name)
Parameters
• dimension_name –
• hierarchy_name –
Returns
get(dimension_name, hierarchy_name)
get hierarchy
Parameters
• dimension_name – name of the dimension
• hierarchy_name – name of the hierarchy
Returns
get_all_names(dimension_name)
get all names of existing Hierarchies in a dimension
Parameters dimension_name –
Returns
get_default_member(dimension_name, hierarchy_name=None)
Get the defined default_member for a Hierarchy. Will return the element with index 1, if default member
is not specified explicitly in }HierarchyProperty Cube
Parameters
• dimension_name –
• hierarchy_name –
Returns String, name of Member
get_hierarchy_summary(dimension_name, hierarchy_name)
update(hierarchy)
update a hierarchy. It’s a two step process: 1. Update Hierarchy 2. Update Element-Attributes
Function caters for Bug with Edge Creation: [Link]
html/topic?id=75f2b99e-6961-4c71-9364-1d5e1e083eff

32 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Parameters hierarchy – instance of [Link]


Returns list of responses
update_default_member(dimension_name, hierarchy_name=None, member_name=”)
Update the default member of a hierarchy. Currently implemented through TI, since TM1 API does not
supports default member updates yet.
Parameters
• dimension_name –
• hierarchy_name –
• member_name –
Returns

2.3.10 [Link] module

class [Link](rest)
Bases: [Link]
Service to Query and Cancel Threads in TM1
cancel_thread(thread_id)
Kill a running thread
Parameters thread_id –
Returns
disconnect_user(user_name)
Disconnect User
Parameters user_name –
Returns
get_active_users()
Get the activate users in TM1
Returns List of [Link] instances
get_threads()
Return a dict of the currently running threads from the TM1 Server
Returns dict: the response
user_is_active(user_name)
Check if user is currently active in TM1
Parameters user_name –
Returns Boolean

2.3.11 [Link] module

class [Link](rest_service)
Parentclass for all Object Services
determine_actual_object_name(object_class, object_name)
version

2.3. [Link] package 33


TM1py Documentation, Release 1.0.2

2.3.12 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TI Processes
compile(name)
Compile a Process. Return List of Syntax errors.
Parameters name –
Returns
create(process)
Create a new process on TM1 Server
Parameters process – Instance of [Link] class
Returns Response
delete(name)
Delete a process in TM1
Parameters name –
Returns Response
execute(process_name, parameters=None, **kwargs)
Ask TM1 Server to execute a process. Call with parameter names as keyword arguments:
[Link](“[Link]”, pLegalEntity=”UK01”)
Parameters
• process_name –
• parameters – Deprecated! dictionary, e.g. {“Parameters”: [ { “Name”: “pLegalEn-
tity”, “Value”: “UK01” }] }
Returns
execute_ti_code(lines_prolog, lines_epilog=None)
Execute lines of code on the TM1 Server
Parameters
• lines_prolog – list - where each element is a valid statement of TI code.
• lines_epilog – list - where each element is a valid statement of TI code.
execute_with_return(process_name, **kwargs)
Ask TM1 Server to execute a process. pass process parameters as keyword arguments to this function.
E.g:
[Link].execute_with_return( process_name=”[Link]”, pWaitSec=2)

Parameters
• process_name – name of the TI process
• kwargs – names of process parameters
Returns success (boolean), status (String), error_log_file (String)

exists(name)
Check if Process exists.

34 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Parameters name –
Returns
get(name_process)
Get a process from TM1 Server
Parameters name_process –
Returns Instance of the [Link]
get_all()
Get a processes from TM1 Server
Returns List, instances of the [Link]
get_all_names()
Get List with all process names from TM1 Server
Returns List of Strings
get_all_process_names_filtered()
Get List with all process names from TM1 Server.
Does not return:
• system process
• Processes that have Subset as Datasource

Returns List of Strings

get_error_log_file_content(file_name)
Get content of error log file (e.g. TM1ProcessError_20180926213819_65708356_979b248b-
[Link])
Parameters file_name – name of the error log file in the TM1 log directory
Returns String, content of the file
get_last_message_from_processerrorlog(process_name)
Get the latest ProcessErrorLog from a process entity
Parameters process_name – name of the process
Returns String - the errorlog, e.g.: “Fehler: Prolog Prozedurzeile (9): Zeichenfolge “US772131
kann nicht in eine reelle Zahl umgewandelt werden.”
get_processerrorlogs(process_name)
Get all ProcessErrorLog entries for a process
Parameters process_name – name of the process
Returns list - Collection of ProcessErrorLogs
update(process)
Update an existing Process on TM1 Server
Parameters process – Instance of [Link] class
Returns Response

2.3. [Link] package 35


TM1py Documentation, Release 1.0.2

2.3.13 [Link] module

class [Link](**kwargs)
Low level communication with TM1 instance through HTTP. Allows to execute HTTP Methods
• GET
• POST
• PATCH
• DELETE

Takes Care of
• Encodings
• TM1 User-Login
• HTTP Headers
• HTTP Session Management
• Response Handling

Based on requests module


DELETE(request, data=”)
Delete request against TM1 instance
Parameters
• request – String, for instance : /api/v1/Dimensions(‘plan_business_unit’)
• data – String, empty
Returns String, the response in text
GET(request, data=”)
Perform a GET request against TM1 instance
Parameters
• request – String, for instance : /api/v1/Cubes?$top=1
• data – String, empty
Returns String, the response as text
HEADERS = {'Accept': 'application/json;[Link]=none,text/plain', 'Connection':
PATCH(request, data=”)
PATCH request against the TM1 instance
Parameters
• request – String, for instance : /api/v1/Dimensions(‘plan_business_unit’)
• data – String, the payload (json)
Returns String, the response as text
POST(request, data=”)
POST request against the TM1 instance
Parameters
• request – String, /api/v1/Cubes

36 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

• data – String, the payload (json)


Returns String, the response as text
add_http_header(key, value)
static b64_decode_password(encrypted_password)
b64 decoding
Parameters encrypted_password – encrypted password with b64
Returns password in plain text
static disable_http_warnings()
get_http_header(key)
is_connected()
Check if Connection to TM1 Server is established.
Returns Boolean
logout()
End TM1 Session and HTTP session
remove_http_header(key)
session_id
set_version()
static translate_to_boolean(value)
Takes a boolean or string (eg. true, True, FALSE, etc.) value and returns (boolean) True or False
Parameters value – True, ‘true’, ‘false’ or ‘False’ . . .
Returns
static verify_response(response)
check if Status Code is OK
Parameters
response: String the response that is returned from a method call
Exceptions TM1pyException, raises TM1pyException when Code is not 200, 204 etc.
version
[Link](func)
Higher Order Function to wrap the GET, POST, PATCH, PUT, DELETE methods
Takes care of: - encoding of url and payload - verifying response. Throws TM1pyException if StatusCode of
Response is not OK

2.3.14 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Security stuff
add_user_to_groups(user_name, groups)
Parameters
• user_name – name of user

2.3. [Link] package 37


TM1py Documentation, Release 1.0.2

• groups – iterable of groups


Returns response
create_group(group_name)
Create a Security group in the TM1 Server
Parameters group_name –
Returns
create_user(user)
Create a user on TM1 Server
Parameters user – instance of [Link]
Returns response
delete_group(group_name)
Delete a group in the TM1 Server
Parameters group_name –
Returns
delete_user(user_name)
Delete user on TM1 Server
Parameters user_name –
Returns response
determine_actual_group_name(group_name)
determine_actual_user_name(user_name)
get_all_groups()
Get all groups from TM1 Server
Returns List of strings
get_all_user_names()
Get all user names from TM1 Server
Returns List of [Link] instances
get_all_users()
Get all users from TM1 Server
Returns List of [Link] instances
get_current_user()
Get user and group assignments of this session
Returns instance of [Link]
get_groups(user_name)
Get the groups of a user in TM1 Server
Parameters user_name –
Returns List of strings
get_user(user_name)
Get user from TM1 Server
Parameters user_name –

38 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Returns instance of [Link]


get_user_names_from_group(group_name)
Get all users from group
Parameters group_name –
Returns List of strings
get_users_from_group(group_name)
Get all users from group
Parameters group_name –
Returns List of [Link] instances
remove_user_from_group(group_name, user_name)
Remove user from group in TM1 Server
Parameters
• group_name –
• user_name –
Returns response
security_refresh()
update_user(user)
Update user on TM1 Server
Parameters user – instance of [Link]
Returns response

2.3.15 [Link] module

class [Link](rest)
Bases: [Link]
Service to query common information from the TM1 Server
execute_message_log_delta_request(*args, **kwargs)
execute_transaction_log_delta_request(*args, **kwargs)
get_active_configuration()
Read current effective(!) TM1 config settings as dictionary from TM1 Server
Returns config as dictionary
get_admin_host()
get_configuration()
get_data_directory()
get_last_process_message_from_messagelog(process_name)
Get the latest messagelog entry for a process
Parameters process_name – name of the process
Returns String - the message, for instance: “Ausführung normal beendet, verstrichene Zeit 0.03
Sekunden”
get_message_log_entries(reverse=True, top=None)

2.3. [Link] package 39


TM1py Documentation, Release 1.0.2

get_product_version()
Ask TM1 Server for its version
Returns String, the version
get_server_name()
Ask TM1 Server for its name
Returns String, the server name
get_static_configuration()
Read current applied (!) TM1 config settings as dictionary from TM1 Server
Returns config as dictionary
get_transaction_log_entries(reverse=True, user=None, cube=None, since=None,
top=None)
Parameters
• reverse –
• user –
• cube –
• since – of type datetime. If it doesn’t have tz information, UTC is assumed.
• top –
Returns
initialize_message_log_delta_requests(*args, **kwargs)
initialize_transaction_log_delta_requests(*args, **kwargs)
save_data()
update_static_configuration(configuration)
Update the .cfg file and triggers TM1 to re-read the file.
Parameters configuration –
Returns Response
[Link].odata_track_changes_header(func)
Higher Order function to handle addition and removal of [Link]-changes HTTP Header
Parameters func –
Returns

2.3.16 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for TM1 Subsets (dynamic and static)
create(subset, private=True)
create subset on the TM1 Server
Parameters
• subset – [Link], the subset that shall be created
• private – boolean

40 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

Returns string: the response


delete(subset_name, dimension_name, hierarchy_name=None, private=True)
Delete an existing subset on the TM1 Server
Parameters
• subset_name – String, name of the subset
• dimension_name – String, name of the dimension
• hierarchy_name – String, name of the hierarchy
• private – Boolean
Returns
delete_elements_from_static_subset(dimension_name, hierarchy_name, subset_name,
private)
exists(subset_name, dimension_name, hierarchy_name=None, private=True)
checks if private or public subset exists
Parameters
• subset_name –
• dimension_name –
• hierarchy_name –
• private –
Returns boolean
get(subset_name, dimension_name, hierarchy_name=None, private=True)
get a subset from the TM1 Server
Parameters
• subset_name – string, name of the subset
• dimension_name – string, name of the dimension
• hierarchy_name – string, name of the hierarchy
• private – Boolean
Returns instance of [Link]
get_all_names(dimension_name, hierarchy_name=None, private=True)
get names of all private or public subsets in a hierarchy
Parameters
• dimension_name –
• hierarchy_name –
• private – Boolean
Returns List of Strings
update(subset, private=True)
update a subset on the TM1 Server
Parameters
• subset – instance of [Link].

2.3. [Link] package 41


TM1py Documentation, Release 1.0.2

• private – Boolean
Returns response

2.3.17 [Link].TM1Service module

class [Link].TM1Service.TM1Service(**kwargs)
All features of TM1py are exposed through this service
Can be saved and restored from File, to avoid multiple authentication with TM1.
connection
logout()
classmethod restore_from_file(file_name)
save_to_file(file_name)
version
whoami

2.3.18 [Link] module

class [Link](rest)
Bases: [Link]
Service to handle Object Updates for cube views (NativeViews and MDXViews)
create(view, private=True)
create a new view on TM1 Server
Parameters
• view – instance of subclass of [Link] ([Link] or [Link])
• private – boolean
Returns Response
delete(cube_name, view_name, private=True)
Delete an existing view (MDXView or NativeView) on the TM1 Server
Parameters
• cube_name – String, name of the cube
• view_name – String, name of the view
• private – Boolean
Returns String, the response
exists(cube_name, view_name, private=None)
Checks if view exists as private, public or both
Parameters
• cube_name – string, name of the cube
• view_name – string, name of the view
• private – boolean, if None: check for private and public

42 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

:return boolean tuple


get(cube_name, view_name, private=True)
get_all(cube_name)
Get all public and private views from cube.
Parameters cube_name – String, name of the cube.
Returns 2 Lists of [Link] instances: private views, public views
get_all_names(cube_name)
Parameters cube_name –
Returns
get_mdx_view(cube_name, view_name, private=True)
Get an MDXView from TM1 Server
Parameters
• cube_name – String, name of the cube
• view_name – String, name of the MDX view
• private – boolean
Returns instance of [Link]
get_native_view(cube_name, view_name, private=True)
Get a NativeView from TM1 Server
Parameters
• cube_name – string, name of the cube
• view_name – string, name of the native view
• private – boolean
Returns instance of [Link]
update(view, private=True)
Update an existing view
Parameters
• view – instance of [Link] or [Link]
• private – boolean
Returns response

2.3. [Link] package 43


TM1py Documentation, Release 1.0.2

2.3.19 Module contents

2.4 [Link] package

2.4.1 Submodules

2.4.2 [Link] module

class [Link](dimension_name, elements=None, sub-


set=None, expression=None)
Instances of this class to be passed to construct_mdx function
EXPRESSION = 2
ITERABLE = 3
SUBSET = 1
static determine_selection_type(elements=None, subset=None, expression=None)
[Link].construct_mdx(cube_name, rows, columns, contexts=None, sup-
press=None)
Method to construct MDX Query from different dimension selection
Parameters
• cube_name – Name of the Cube
• rows – List of DimensionSelections
• columns – List of DimensionSelections
• contexts – Dictionary of Dimensions and Elements
• suppress – “Both”, “Rows”, “Columns” or None
Returns Generated MDX Query
[Link].construct_mdx_axis(dim_selections)
Construct MDX for one Axis (Row or Column). Can have multiple dimensions stacked.
Parameters dim_selections – instances of [Link]
Returns a valid MDX for an Axis
[Link].curly_braces(expression)
Put curly braces around a string
Parameters expression –
Returns
[Link].read_cube_name_from_mdx(mdx)
Read the cube name from a valid MDX Query
Parameters mdx – The MDX Query as String
Returns String, name of a cube
[Link].read_dimension_composition_from_mdx(mdx)
Parse a valid MDX Query and return the name of the cube and a list of dimensions for each axis
Parameters mdx –
Returns

44 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

[Link].read_dimension_composition_from_mdx_set(mdx)
[Link].read_dimension_composition_from_mdx_set_or_tuple(mdx)
[Link].read_dimension_composition_from_mdx_tuple(mdx)
[Link].split_mdx(mdx)

2.4.3 [Link] module

[Link].generate_unique_string(code)
[Link].get_all_defined_variables(code)
[Link].obfuscate_code(code, variable_mapping, unique_string)
[Link].obfuscate_process(process, new_name=None)
[Link].remove_comment_lines(code)
[Link].remove_generated_code(code)
Remove The generated code lines that are in between # *** comments
Parameters code –
Returns
[Link].split_into_statements(code)
code from one Tab. Code String must come Without Comment-lines !
Parameters code –
Returns

2.4.4 [Link] module

class [Link](data=None, **kwargs)


Bases: _abcoll.MutableMapping
A case-and-space-insensitive dict-like object with String keys.
Implements all methods and operations of [Link] as well as dict’s copy. Also
provides adjusted_items, adjusted_keys.
All keys are expected to be strings. The structure remembers the case of the last key to be set, and
iter(instance), keys(), items(), iterkeys(), and iteritems() will contain case-sensitive
keys.
However, querying and contains testing is case insensitive: elements = TM1pyElementsDictionary() ele-
ments[‘Travel Expesnses’] = 100 elements[‘travelexpenses’] == 100 # True
Entries are ordered
adjusted_items()
Like iteritems(), but with all adjusted keys.
adjusted_keys()
Like keys(), but with all adjusted keys.
copy()
class [Link](*values)
Bases: _abcoll.MutableSet

2.4. [Link] package 45


TM1py Documentation, Release 1.0.2

add(value)
Add an element.
copy()
discard(value)
Remove an element. Do not raise an exception if absent.
class [Link](data=None, **kwargs)
Bases: _abcoll.MutableMapping
A case-and-space-insensitive dict-like object with String-Tuples Keys.
Implements all methods and operations of [Link] as well as dict’s copy. Also
provides adjusted_items, adjusted_keys.
All keys are expected to be tuples of strings. The structure remembers the case of the last key to be set, and
iter(instance), keys(), items(), iterkeys(), and iteritems() will contain case-sensitive
keys.
However, querying and contains testing is case insensitive: data = CaseAndSpaceInsensitiveTuplesDict()
data[(‘[Business Unit].[UK]’, ‘[Scenario].[Worst Case]’)] = 1000 data[(‘[BusinessUnit].[UK]’, ‘[Sce-
nario].[worstcase]’)] == 1000 # True data[(‘[Business Unit].[UK]’, ‘[Scenario].[Worst Case]’)] == 1000 #
True
Entries are ordered
adjusted_items()
Like iteritems(), but with all adjusted keys.
adjusted_keys()
Like keys(), but with all adjusted keys.
copy()
[Link].build_cellset_from_pandas_dataframe(df )
Parameters df – a Pandas Dataframe, with dimension-column mapping in correct order. As created
in build_pandas_dataframe_from_cellset
Returns a CaseAndSpaceInsensitiveTuplesDict
[Link].build_content_from_cellset(raw_cellset_as_dict, top=None)
transform raw cellset data into concise dictionary
Parameters
• raw_cellset_as_dict –
• top – Maximum Number of cells
Returns
[Link].build_element_unique_names(dimension_names, element_names, hierar-
chy_names=None)
Create tuple of unique names from dimension, hierarchy and elements
Parameters
• dimension_names –
• element_names –
• hierarchy_names –
Returns Generator

46 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

[Link].build_headers_from_cellset(raw_cellset_as_dict,
force_header_dimensionality=1)
Extract dimension headers from cellset into dictionary of titles (slicers) and headers (row,column,page) * Title
dimensions are in a single list of dicts * Header dimensions are a 2-dimensional list of the element dicts
• The first dimension in the header list is the axis
• The second dimension is the list of elements on the axis

• Dict format: {‘name’: ‘element or compound name’, ‘members’: [ {dict of dimension properties}, . . . ] }
– Stacked headers on an axis will have a compount ‘name’ created by joining the member’s ‘Name’
properties with a ‘/’
– Stacked headers will each be listed in the ‘memebers’ list; Single-element headers will only have one
element in list

Parameters
• raw_cellset_as_dict – raw data from TM1
• force_header_dimensionality – An optional integer (1,2 or 3) to force headers
array to be at least that long
Returns dict : { titles: [ { ‘name’: ‘xx’, ‘members’: {} } ], headers: [axis][ { ‘name’: ‘xx’,
‘members’: {} } ] }

[Link].build_pandas_dataframe_from_cellset(cellset, multiindex=True,
sort_values=True)
Parameters
• cellset –
• multiindex – True or False
• sort_values – Boolean to control sorting in result DataFrame
Returns
[Link].build_ui_arrays_from_cellset(raw_cellset_as_dict, value_precision)
Transform raw 1,2 or 3-dimension cellset data into concise dictionary
• Useful for grids or charting libraries that want an array of cell values per row
• Returns 3-dimensional cell structure for tabbed grids or multiple charts
• Rows and pages are dicts, addressable by their name. Proper order of rows can be obtained in headers[1]
• Example ‘cells’ return format:
‘cells’: {
‘10100’: {
‘Net Operating Income’: [ 19832724.72429739, 20365654.788303416,
20729201.329183243, 20480205.20121749],
‘Revenue’: [ 28981046.50724231, 29512482.207418434, 29913730.038971487,
29563345.9542385]},
‘10200’: {
‘Net Operating Income’: [ 9853293.623709997, 10277650.763958748,
10466934.096533755, 10333095.839474997],

2.4. [Link] package 47


TM1py Documentation, Release 1.0.2

‘Revenue’: [ 13888143.710000003, 14300216.43, 14502421.63, 14321501.940000001]}


},

Parameters
• raw_cellset_as_dict – raw data from TM1
• value_precision – Integer (optional) specifying number of decimal places to return
Returns dict : { titles: [], headers: [axis][], cells: { Page0: { Row0: { [row values], Row1: [], . . . },
. . . }, . . . } }

[Link].build_ui_dygraph_arrays_from_cellset(raw_cellset_as_dict,
value_precision=None)
Transform raw 1,2 or 3-dimension cellset data into dygraph-friendly format
• Useful for grids or charting libraries that want an array of cell values per column
• Returns 3-dimensional cell structure for tabbed grids or multiple charts
• Example ‘cells’ return format:
‘cells’: {
‘10100’: [ [‘Q1-2004’, 28981046.50724231, 19832724.72429739], [‘Q2-2004’,
29512482.207418434, 20365654.788303416], [‘Q3-2004’, 29913730.038971487,
20729201.329183243], [‘Q4-2004’, 29563345.9542385, 20480205.20121749]],
‘10200’: [ [‘Q1-2004’, 13888143.710000003, 9853293.623709997], [‘Q2-2004’, 14300216.43,
10277650.763958748], [‘Q3-2004’, 14502421.63, 10466934.096533755], [‘Q4-2004’,
14321501.940000001, 10333095.839474997]]
},

Parameters
• raw_cellset_as_dict – raw data from TM1
• value_precision – Integer (optional) specifying number of decimal places to return
Returns dict : { titles: [], headers: [axis][], cells: { Page0: [ [column name, column values], [], . . .
], . . . } }

[Link].case_and_space_insensitive_equals(item1, item2)
[Link].dimension_hierarchy_element_tuple_from_unique_name(element_unique_name)
Extract dimension name, hierarchy name and element name from element unique name. Works with explicit
and implicit hierarchy references.
Parameters element_unique_name – e.g. [d1].[e1] or [d1].[leaves].[e1]
Returns tuple of dimension name, hierarchy name, element name
[Link].dimension_name_from_element_unique_name(element_unique_name)
[Link].element_name_from_element_unique_name(element_unique_name)
[Link].element_names_from_element_unique_names(element_unique_names)
Get tuple of simple element names from the full element unique names
Parameters element_unique_names – tuple of element unique names
([dim1].[hier1].[elem1], . . . )
Returns tuple of element names: (elem1, elem2, . . . )

48 Chapter 2. Subpackages
TM1py Documentation, Release 1.0.2

[Link].element_names_from_element_unqiue_names(element_unique_names)
Get tuple of simple element names from the full element unique names
Parameters element_unique_names – tuple of element unique names
([dim1].[hier1].[elem1], . . . )
Returns tuple of element names: (elem1, elem2, . . . )
[Link].extract_axes_from_cellset(raw_cellset_as_dict)
[Link].extract_unique_names_from_members(members)
Extract list of unique names from part of the cellset response in: [{‘UniqueName’: ‘[dim1].[dim1].[elem1]’,
‘Element’: {‘UniqueName’: ‘[dim1].[dim1].[elem1]’}}, {‘UniqueName’: ‘[dim2].[dim2].[elem3]’, ‘Element’:
{‘UniqueName’: ‘[dim2].[dim2].[elem3]’}}] out: [“[dim1].[dim1].[elem1]”, “[dim2].[dim2].[elem3]”]
Parameters members – dictionary
Returns list of unique names
[Link].get_all_servers_from_adminhost(adminhost=’localhost’)
Ask Adminhost for TM1 Servers
Parameters adminhost – IP or DNS Alias of the adminhost
Returns List of Servers (instances of the [Link] class)
[Link].hierarchy_name_from_element_unique_name(element_unique_name)
[Link].load_all_bedrocks_from_github()
Load all Bedrocks from GitHub as [Link] instances
Returns
[Link].load_bedrock_from_github(bedrock_process_name)
Load bedrock from GitHub as [Link] instance
Parameters bedrock_process_name –
Returns
[Link].lower_and_drop_spaces(item)
[Link].sort_coordinates(cube_dimensions, unsorted_coordinates)

2.4.5 Module contents

2.4. [Link] package 49


TM1py Documentation, Release 1.0.2

50 Chapter 2. Subpackages
Python Module Index

t [Link], 37
TM1py, 1 [Link], 39
[Link], 4 [Link], 40
[Link], 3 [Link].TM1Service, 42
[Link], 16 [Link], 42
[Link], 4 [Link], 49
[Link], 5 [Link], 44
[Link], 5 [Link], 45
[Link], 5 [Link], 45
[Link], 6
[Link], 6
[Link], 7
[Link], 7
[Link], 8
[Link], 8
[Link], 9
[Link], 9
[Link], 10
[Link], 10
[Link], 12
[Link], 14
[Link], 14
[Link], 14
[Link].TM1Object, 15
[Link], 15
[Link], 16
[Link], 44
[Link], 16
[Link], 17
[Link], 17
[Link], 26
[Link], 27
[Link], 29
[Link], 30
[Link], 32
[Link], 33
[Link], 33
[Link], 34
[Link], 36

51
TM1py Documentation, Release 1.0.2

52 Python Module Index


Index

A add_user_to_groups()
activate() ([Link] method), 5 ([Link]
activate() ([Link] method), 37
method), 26 add_variable() ([Link]
activate_transactionlog() method), 12
([Link] adjusted_items() ([Link]
method), 17 method), 45
active ([Link] attribute), 5 adjusted_items() ([Link]
add() ([Link] method), 46
method), 6 adjusted_keys() ([Link]
add() ([Link] method), 45
method), 45 adjusted_keys() ([Link]
add_column() ([Link] method), 46
method), 10 alias ([Link] attribute), 15
add_edge() ([Link] Annotation (class in [Link]), 4
method), 9 AnnotationService (class in
add_element() ([Link] [Link]), 16
method), 9 AnonymousSubset (class in [Link]),
add_element_attribute() 14
([Link] method), Application (class in [Link]), 5
9 ApplicationService (class in
add_elements() ([Link] [Link]), 17
method), 15 as_MDX ([Link] at-
add_generated_string_to_code() tribute), 11
([Link] static attribute_type ([Link]
method), 12 attribute), 9
add_group() ([Link] method), 15 auto_generated_string
add_hierarchy() ([Link] ([Link] attribute), 13
method), 8
add_http_header() B
([Link] b64_decode_password()
method), 37 ([Link]
add_parameter() ([Link] static method), 37
method), 12 balanced ([Link] at-
add_row() ([Link] tribute), 9
method), 11 begin_generated_statements
add_task() ([Link] method), 5 ([Link] attribute), 13
add_title() ([Link] body ([Link] attribute),
method), 11 4

53
TM1py Documentation, Release 1.0.2

body ([Link] attribute), method), 33


5 case_and_space_insensitive_equals() (in
body ([Link] attribute), module [Link]), 48
5 CaseAndSpaceInsensitiveDict (class in
body ([Link] attribute), 5 [Link]), 45
body ([Link] attribute), 7 CaseAndSpaceInsensitiveSet (class in
body ([Link] attribute), 7 [Link]), 45
body ([Link] attribute), CaseAndSpaceInsensitiveTuplesDict (class
8 in [Link]), 46
body ([Link] attribute), 8 CellService (class in [Link]),
body ([Link] 17
attribute), 9 Chore (class in [Link]), 5
body ([Link] attribute), 9 ChoreFrequency (class in
body ([Link] attribute), 10 [Link]), 6
body ([Link] attribute), ChoreService (class in
11 [Link]), 26
body ([Link] attribute), 13 ChoreStartTime (class in
body ([Link] attribute), 15 [Link]), 6
body ([Link].TM1Object.TM1Object attribute), ChoreTask (class in [Link]), 7
15 columns ([Link] at-
body ([Link] attribute), 16 tribute), 11
body_as_dict ([Link] comment_value ([Link]
attribute), 5 attribute), 4
body_as_dict ([Link] at- compile() ([Link]
tribute), 5 method), 34
body_as_dict ([Link] connection ([Link].TM1Service.TM1Service
attribute), 7 attribute), 42
body_as_dict ([Link] construct_body() ([Link]
attribute), 8 method), 5
body_as_dict ([Link] at- construct_body() ([Link]
tribute), 8 method), 10
body_as_dict ([Link]
construct_body() ([Link]
attribute), 9 method), 16
body_as_dict ([Link] construct_mdx() (in module
attribute), 9 [Link]), 44
body_as_dict ([Link] at- construct_mdx_axis() (in module
tribute), 15 [Link]), 44
build_cellset_from_pandas_dataframe() contains_element()
(in module [Link]), 46 ([Link] method),
build_content_from_cellset() (in module 9
[Link]), 46 contains_hierarchy()
build_element_unique_names() (in module ([Link]
[Link]), 46 method), 8
build_headers_from_cellset() (in module copy() ([Link]
[Link]), 46 method), 45
build_pandas_dataframe_from_cellset() copy() ([Link]
(in module [Link]), 47 method), 46
build_ui_arrays_from_cellset() (in module copy() ([Link]
[Link]), 47 method), 46
build_ui_dygraph_arrays_from_cellset() create() ([Link]
(in module [Link]), 48 method), 16
create() ([Link]
C method), 26
create()
cancel_thread() ([Link] ([Link]

54 Index
TM1py Documentation, Release 1.0.2

method), 28 datasource_data_source_name_for_server
create() ([Link] ([Link] attribute), 13
method), 29 datasource_password
create() ([Link] ([Link] attribute), 13
method), 30 datasource_query ([Link]
create() ([Link] attribute), 13
method), 32 datasource_subset
create() ([Link] ([Link] attribute), 13
method), 34 datasource_type ([Link]
create() ([Link] attribute), 13
method), 40 datasource_user_name
create() ([Link] ([Link] attribute), 13
method), 42 datasource_uses_unicode
create_cellset() ([Link] ([Link] attribute), 13
method), 17 datasource_view ([Link]
create_cellset_from_view() attribute), 13
([Link] days ([Link]
method), 18 attribute), 6
create_element_attribute() deactivate() ([Link] method),
([Link] 5
method), 30 deactivate() ([Link]
create_element_attributes_through_ti() method), 26
([Link]
deactivate_activate() (in module
method), 29 [Link]), 27
create_group() ([Link]
deactivate_transactionlog()
method), 38 ([Link]
create_user() ([Link] method), 18
method), 38 default_hierarchy
created ([Link] ([Link] at-
attribute), 4 tribute), 8
Cube (class in [Link]), 7 default_member ([Link]
cube ([Link] attribute), 16 attribute), 9
CubeService (class in [Link]), delete() ([Link]
27 method), 17
curly_braces() (in module [Link]), delete() ([Link]
44 method), 26
delete() ([Link]
D method), 28
data_procedure ([Link] delete() ([Link]
attribute), 13 method), 29
datasource_ascii_decimal_separator delete() ([Link]
([Link] attribute), 13 method), 30
datasource_ascii_delimiter_char delete() ([Link]
([Link] attribute), 13 method), 32
datasource_ascii_delimiter_type delete() ([Link]
([Link] attribute), 13 method), 34
datasource_ascii_header_records DELETE() ([Link]
([Link] attribute), 13 method), 36
datasource_ascii_quote_character delete() ([Link]
([Link] attribute), 13 method), 41
datasource_ascii_thousand_separator delete() ([Link]
([Link] attribute), 13 method), 42
datasource_data_source_name_for_client delete_cellset() ([Link]
([Link] attribute), 13 method), 18

Index 55
TM1py Documentation, Release 1.0.2

delete_element_attribute() dst_sensitivity ([Link] at-


([Link] tribute), 5
method), 30
delete_elements_from_static_subset() E
([Link] edges ([Link] attribute),
method), 41 9
delete_group() ([Link]
EDGES_WORKAROUND_VERSIONS
method), 38 ([Link]
delete_user() ([Link] attribute), 32
method), 38 Element (class in [Link]), 8
determine_actual_group_name() element_attributes
([Link] ([Link] attribute), 8
method), 38 element_attributes
determine_actual_object_name() ([Link] at-
([Link] tribute), 9
method), 33 element_name_from_element_unique_name()
determine_actual_user_name() (in module [Link]), 48
([Link] element_names_from_element_unique_names()
method), 38 (in module [Link]), 48
determine_selection_type() element_names_from_element_unqiue_names()
([Link] (in module [Link]), 48
static method), 44 element_type ([Link] at-
Dimension (class in [Link]), 8 tribute), 8
dimension_hierarchy_element_tuple_from_unique_name() ElementAttribute (class in
(in module [Link]), 48 [Link]), 9
dimension_name ([Link] elements ([Link] at-
attribute), 5 tribute), 10
dimension_name ([Link] elements ([Link] attribute), 15
attribute), 5 ElementService (class in
dimension_name ([Link] [Link]), 30
attribute), 9 end_generated_statements
dimension_name ([Link] at- ([Link] attribute), 13
tribute), 15 epilog_procedure ([Link]
dimension_name_from_element_unique_name() attribute), 13
(in module [Link]), 48 execute() ([Link]
dimensional_context method), 34
([Link] at- execute_chore() ([Link]
tribute), 4 method), 27
dimensions ([Link] attribute), 7 execute_mdx() ([Link]
DimensionSelection (class in method), 18
[Link]), 44 execute_mdx() ([Link]
DimensionService (class in method), 29
[Link]), 29 execute_mdx_cellcount()
disable_http_warnings() ([Link]
([Link] method), 18
static method), 37 execute_mdx_csv()
discard() ([Link] ([Link]
method), 46 method), 18
disconnect_user() execute_mdx_dataframe()
([Link] ([Link]
method), 33 method), 18
drop_parameter_types() execute_mdx_dataframe_pivot()
([Link] method), ([Link]
13 method), 18

56 Index
TM1py Documentation, Release 1.0.2

execute_mdx_raw() ([Link]
([Link] method), 34
method), 19 execution_mode ([Link] at-
execute_mdx_rows_and_values() tribute), 5
([Link] exists() ([Link]
method), 19 method), 27
execute_mdx_ui_array() exists() ([Link]
([Link] method), 28
method), 19 exists() ([Link]
execute_mdx_ui_dygraph() method), 29
([Link] exists() ([Link]
method), 20 method), 30
execute_mdx_values() exists() ([Link]
([Link] method), 32
method), 20 exists() ([Link]
execute_message_log_delta_request() method), 34
([Link] exists() ([Link]
method), 39 method), 41
execute_ti_code() exists() ([Link]
([Link] method), 42
method), 34 expression ([Link] attribute),
execute_transaction_log_delta_request() 15
([Link] EXPRESSION ([Link]
method), 39 attribute), 44
execute_view() ([Link]
extract_axes_from_cellset() (in module
method), 20 [Link]), 49
execute_view_cellcount() extract_cellset()
([Link] ([Link]
method), 21 method), 23
execute_view_csv() extract_cellset_cellcount()
([Link] ([Link]
method), 21 method), 23
execute_view_dataframe() extract_cellset_composition()
([Link] ([Link]
method), 21 method), 24
execute_view_dataframe_pivot() extract_cellset_csv()
([Link] ([Link]
method), 21 method), 24
execute_view_raw() extract_cellset_dataframe_pivot()
([Link] ([Link]
method), 21 method), 24
execute_view_rows_and_values() extract_cellset_raw()
([Link] ([Link]
method), 22 method), 24
execute_view_ui_array() extract_cellset_rows_and_values()
([Link] ([Link]
method), 22 method), 24
execute_view_ui_dygraph() extract_cellset_values()
([Link] ([Link]
method), 22 method), 24
execute_view_values() extract_unique_names_from_members() (in
([Link] module [Link]), 49
method), 23
execute_with_return()

Index 57
TM1py Documentation, Release 1.0.2

F method), 13
feeder_statements ([Link] from_json() ([Link]
attribute), 14 class method), 14
feedstrings ([Link] attribute), 7 from_json() ([Link] class
feedstrings ([Link] attribute), method), 15
14 from_json() ([Link] class
format_string ([Link] method), 16
attribute), 11 from_string() ([Link]
frequency ([Link] attribute), 5 class method), 6
from_string()
frequency_string ([Link] ([Link]
attribute), 6 class method), 6
friendly_name ([Link] attribute),
16 G
from_dict() ([Link] class generate_unique_string() (in module
method), 6 [Link]), 45
from_dict() ([Link] get() ([Link]
class method), 7 method), 17
from_dict() ([Link] class get() ([Link]
method), 7 method), 17
from_dict() ([Link] get() ([Link]
class method), 8 method), 27
from_dict() ([Link] static get() ([Link]
method), 8 method), 28
get()
from_dict() ([Link]([Link]
class method), 9 method), 29
from_dict() ([Link] get() ([Link]
class method), 10 method), 30
from_dict() ([Link] get() ([Link]
class method), 10 method), 32
from_dict() ([Link] get() ([Link]
class method), 11 method), 35
from_dict() ([Link] class GET() ([Link]
method), 13 method), 36
from_dict() ([Link] get() ([Link]
class method), 14 method), 41
from_dict() ([Link] class get() ([Link]
method), 15 method), 43
from_dict() ([Link] class get_active_configuration()
method), 16 ([Link]
from_json() ([Link] method), 39
class method), 4 get_active_users()
from_json() ([Link] class ([Link]
method), 6 method), 33
from_json() ([Link] class get_admin_host() ([Link]
method), 7 method), 39
from_json() ([Link] get_all() ([Link]
class method), 8 method), 17
get_all() ([Link]
from_json() ([Link]
class method), 9 method), 27
from_json() ([Link] get_all() ([Link]
class method), 10 method), 28
from_json() ([Link] get_all() ([Link]
class method), 11 method), 35
from_json() ([Link] class

58 Index
TM1py Documentation, Release 1.0.2

get_all() ([Link] ([Link]


method), 43 method), 30
get_all_defined_variables() (in module get_element_names()
[Link]), 45 ([Link]
get_all_groups() ([Link]
method), 31
method), 38 get_elements() ([Link]
get_all_names() ([Link] method), 31
method), 27 get_elements_filtered_by_attribute()
get_all_names() ([Link] ([Link]
method), 28 method), 31
get_all_names() ([Link]
get_error_log_file_content()
method), 30 ([Link]
get_all_names() ([Link]
method), 35
method), 32 get_groups() ([Link]
get_all_names() ([Link] method), 38
method), 35 get_hierarchy() ([Link]
get_all_names() ([Link] method), 8
method), 41 get_hierarchy_summary()
get_all_names() ([Link] ([Link]
method), 43 method), 32
get_all_process_names_filtered() get_http_header()
([Link] ([Link]
method), 35 method), 37
get_all_servers_from_adminhost() (in mod- get_last_message_from_processerrorlog()
ule [Link]), 49 ([Link]
get_all_user_names() method), 35
([Link] get_last_process_message_from_messagelog()
method), 38 ([Link]
get_all_users() ([Link]
method), 39
method), 38 get_leaf_element_names()
get_cellset_cells_count() ([Link]
([Link] method), 31
method), 24 get_leaf_elements()
get_configuration() ([Link]
([Link] method), 31
method), 39 get_leaves_under_consolidation()
get_control_cubes() ([Link]
([Link] method), 31
method), 28 get_mdx_view() ([Link]
get_current_user() method), 43
([Link] get_members_under_consolidation()
method), 38 ([Link]
get_data_directory() method), 31
([Link] get_message_log_entries()
method), 39 ([Link]
get_default_member() method), 39
([Link]
get_model_cubes()
method), 32 ([Link]
get_dimension_names() method), 28
([Link] get_native_view()
method), 28 ([Link]
get_element() ([Link] method), 43
method), 10 get_processerrorlogs()
get_element_attributes() ([Link]

Index 59
TM1py Documentation, Release 1.0.2

method), 35 hierarchy_name_from_element_unique_name()
get_product_version() (in module [Link]), 49
([Link] hierarchy_names ([Link]
method), 40 attribute), 8
get_random_intersection() HierarchyService (class in
([Link] [Link]), 32
method), 28 hours ([Link]
get_server_name() attribute), 6
([Link] httpmethod() (in module
method), 40 [Link]), 37
get_static_configuration()
([Link] I
method), 40 id ([Link] attribute), 4
get_storage_dimension_order() index ([Link] attribute), 8
([Link] init_analytics() ([Link]
method), 28 method), 14
get_threads() ([Link]
initialize_message_log_delta_requests()
method), 33 ([Link]
get_transaction_log_entries() method), 40
([Link] initialize_transaction_log_delta_requests()
method), 40 ([Link]
get_user() ([Link] method), 40
method), 38 is_admin ([Link] attribute), 16
get_user_names_from_group() is_connected() ([Link]
([Link] method), 37
method), 39 is_dynamic ([Link] attribute),
get_users_from_group() 15
([Link] is_static ([Link] attribute),
method), 39 15
get_value() ([Link] ITERABLE ([Link]
method), 24 attribute), 44
get_view_content()
([Link] K
method), 25 keywords ([Link] attribute), 14
groups ([Link] attribute), 16
L
H last_updated ([Link]
has_feeders ([Link] attribute), attribute), 4
14 last_updated_by ([Link]
has_rules ([Link] attribute), 7 attribute), 4
has_security_access load_all_bedrocks_from_github() (in mod-
([Link] attribute), 13 ule [Link]), 49
HEADERS ([Link] load_bedrock_from_github() (in module
attribute), 36 [Link]), 49
hierarchies ([Link] logout() ([Link]
attribute), 8 method), 37
Hierarchy (class in [Link]), 9 logout() ([Link].TM1Service.TM1Service
hierarchy_name ([Link] method), 42
attribute), 5 lower_and_drop_spaces() (in module
hierarchy_name ([Link] [Link]), 49
attribute), 5
hierarchy_name ([Link] at- M
tribute), 15
MDX ([Link] attribute), 10

60 Index
TM1py Documentation, Release 1.0.2

MDX ([Link] attribute), prolog_procedure ([Link]


10 attribute), 13
MDXView (class in [Link]), 10
metadata_procedure R
([Link] attribute), 13 read_cube_name_from_mdx() (in module
minutes ([Link] [Link]), 44
attribute), 6 read_dimension_composition_from_mdx()
MonitoringService (class in (in module [Link]), 44
[Link]), 33 read_dimension_composition_from_mdx_set()
move() ([Link] (in module [Link]), 44
method), 4 read_dimension_composition_from_mdx_set_or_tuple()
(in module [Link]), 45
N read_dimension_composition_from_mdx_tuple()
name ([Link] attribute), 6 (in module [Link]), 45
name ([Link] attribute), 7 reason ([Link].TM1pyException
name ([Link] attribute), attribute), 3
8 relative_proportional_spread()
name ([Link] attribute), 8 ([Link]
name ([Link] method), 25
attribute), 9 remove_column() ([Link]
name ([Link] attribute), 10 method), 11
name ([Link] attribute), 13 remove_comment_lines() (in module
name ([Link] attribute), 15 [Link]), 45
name ([Link] attribute), 16 remove_edge() ([Link]
name ([Link] attribute), 16 method), 10
NativeView (class in [Link]), 10 remove_edges() ([Link]
method), 10
O remove_edges_related_to_element()
obfuscate_code() (in module ([Link] method),
[Link]), 45 10
obfuscate_process() (in module remove_element() ([Link]
[Link]), 45 method), 10
object_name ([Link] remove_element_attribute()
attribute), 4 ([Link] method),
ObjectService (class in 10
[Link]), 33 remove_generated_code() (in module
odata_track_changes_header() (in module [Link]), 45
[Link]), 40 remove_group() ([Link]
method), 16
P remove_hierarchy()
parameters ([Link] at- ([Link]
tribute), 7 method), 8
parameters ([Link] at- remove_http_header()
tribute), 13 ([Link]
password ([Link] attribute), 16 method), 37
PATCH() ([Link] remove_parameter()
method), 36 ([Link] method),
POST() ([Link] 13
method), 36 remove_row() ([Link]
Process (class in [Link]), 12 method), 11
process_name ([Link] remove_title() ([Link]
attribute), 7 method), 11
ProcessService (class in remove_user_from_group()
[Link]), 34 ([Link]

Index 61
TM1py Documentation, Release 1.0.2

method), 39 split_mdx() (in module [Link]), 45


remove_variable() start_time ([Link] attribute), 6
([Link] method), start_time_string
14 ([Link]
reschedule() ([Link] method), attribute), 6
6 status_code ([Link].TM1pyException
response ([Link].TM1pyException attribute), 3
attribute), 3 step ([Link] attribute), 7
restore_from_file() Subset (class in [Link]), 15
([Link].TM1Service.TM1Service subset ([Link] at-
class method), 42 tribute), 5
RESTService (class in [Link]), subset ([Link] at-
36 tribute), 5
rows ([Link] attribute), SUBSET ([Link]
12 attribute), 44
rule_statements ([Link] at- subsets ([Link] at-
tribute), 14 tribute), 10
Rules (class in [Link]), 14 SubsetService (class in
rules ([Link] attribute), 7 [Link]), 40
rules_analytics ([Link] at- substract() ([Link]
tribute), 14 method), 6
suppress_empty_cells
S ([Link] at-
save_data() ([Link] tribute), 12
method), 40 suppress_empty_columns
save_to_file() ([Link].TM1Service.TM1Service ([Link] at-
method), 42 tribute), 12
seconds ([Link] suppress_empty_rows
attribute), 6 ([Link] at-
security_refresh() tribute), 12
([Link]
method), 39 T
SecurityService (class in tasks ([Link] attribute), 6
[Link]), 37 text ([Link] attribute),
selected ([Link] at- 4
tribute), 5 text ([Link] attribute), 14
Server (class in [Link]), 14 tidy_cellset() (in module
ServerService (class in [Link]), 26
[Link]), 39 TM1Object (class in [Link].TM1Object), 15
session_id ([Link] TM1py (module), 1
attribute), 37 [Link] (module), 4
set_local_start_time() [Link] (module), 3
([Link] [Link] (module), 16
method), 27 [Link] (module), 4
set_time() ([Link] [Link] (module), 5
method), 6 [Link] (module), 5
set_version() ([Link] [Link] (module), 5
method), 37 [Link] (module), 6
skipcheck ([Link] attribute), 7 [Link] (module), 6
skipcheck ([Link] attribute), 14 [Link] (module), 7
sort_coordinates() (in module [Link] (module), 7
[Link]), 49 [Link] (module), 8
split_into_statements() (in module [Link] (module), 8
[Link]), 45 [Link] (module), 9

62 Index
TM1py Documentation, Release 1.0.2

[Link] (module), 9 update() ([Link]


[Link] (module), 10 method), 17
[Link] (module), 10 update() ([Link]
[Link] (module), 12 method), 27
[Link] (module), 14 update() ([Link]
[Link] (module), 14 method), 29
[Link] (module), 14 update() ([Link]
[Link].TM1Object (module), 15 method), 30
[Link] (module), 15 update() ([Link]
[Link] (module), 16 method), 31
[Link] (module), 44 update() ([Link]
[Link] (mod- method), 32
ule), 16 update() ([Link]
[Link] (mod- method), 35
ule), 17 update() ([Link]
[Link] (module), 17 method), 41
[Link] (module), 26 update() ([Link]
[Link] (module), 27 method), 43
[Link] (module), update_cellset() ([Link]
29 method), 25
[Link] (module), 30 update_default_member()
[Link] (module), ([Link]
32 method), 33
[Link] (mod- update_edge() ([Link]
ule), 33 method), 10
[Link] (module), 33 update_element() ([Link]
[Link] (module), 34 method), 10
[Link] (module), 36 update_static_configuration()
[Link] (module), ([Link]
37 method), 40
[Link] (module), 39 update_storage_dimension_order()
[Link] (module), 40 ([Link]
[Link].TM1Service (module), 42 method), 29
[Link] (module), 42 update_user() ([Link]
[Link] (module), 49 method), 39
[Link] (module), 44 User (class in [Link]), 15
[Link] (module), 45 user_is_active() ([Link]
[Link] (module), 45 method), 33
TM1pyException, 3
TM1Service (class in [Link].TM1Service), 42 V
to_xlsx() ([Link] valid_types ([Link]
method), 5 attribute), 8
translate_to_boolean() valid_types ([Link]
([Link] attribute), 9
static method), 37 variables ([Link] attribute),
type ([Link] attribute), 15 14
verify_response()
U ([Link]
undefvals ([Link] attribute), 7 static method), 37
undefvals ([Link] attribute), 14 version ([Link]
unique_name ([Link] attribute), 33
attribute), 8 version ([Link]
unique_name ([Link] attribute), 37
attribute), 8

Index 63
TM1py Documentation, Release 1.0.2

version ([Link].TM1Service.TM1Service at-


tribute), 42
View (class in [Link]), 16
ViewAxisSelection (class in [Link]),
5
ViewService (class in [Link]),
42
ViewTitleSelection (class in
[Link]), 5

W
whoami ([Link].TM1Service.TM1Service at-
tribute), 42
write_value() ([Link]
method), 25
write_values() ([Link]
method), 25
write_values_through_cellset()
([Link]
method), 26

64 Index

You might also like