Tm1py

Latest version: v2.1

Safety actively analyzes 714736 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

2.1

What's Changed
* Assure backwards compatability with api/v1 urls by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1057
* Fix (1062): can not use top parameter on execute_mdx_ui_array by Cubewise-Ronan in https://github.com/cubewise-code/tm1py/pull/1063
* Docs: Fix syntax error in the usage examples in the readme by onefloid in https://github.com/cubewise-code/tm1py/pull/1066
* Add VMM and VMT update methods to the cube service. by rclapp in https://github.com/cubewise-code/tm1py/pull/1070
* Fix issue in `get_elements_dataframe` with `use_blob` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1073
* Fix V12 error on retrieving process fields that no longer exist. by cubewise-gng in https://github.com/cubewise-code/tm1py/pull/1081
* Remove obsolete tcp_keepalive parameter by macsir in https://github.com/cubewise-code/tm1py/pull/1077
* Make numpy import optional in ElementService by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1086
* Support for PA Proxy on CP4D and Improved Logout Behaviors by rclapp in https://github.com/cubewise-code/tm1py/pull/1080
* Update ApplicationService.py to support application updates or create by tomasfelcman in https://github.com/cubewise-code/tm1py/pull/1071
* Assure `use_blob` argument doesn't impact result of `get_elements_dataframe` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1084
* Issue/improve tests suite by onefloid in https://github.com/cubewise-code/tm1py/pull/1090, https://github.com/cubewise-code/tm1py/pull/1094, https://github.com/cubewise-code/tm1py/pull/1092, https://github.com/cubewise-code/tm1py/pull/1101, https://github.com/cubewise-code/tm1py/pull/1144, https://github.com/cubewise-code/tm1py/pull/1105
* Assure correct dtypes on attribute columns by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1088
* Simplify `is_admin` determination by onefloid in https://github.com/cubewise-code/tm1py/pull/1104
* Allow IO of files to subfolders in v12 by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1091
* Support double quotes in `execute_mdx_csv` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1112
* Fix bug on `increment=True` in `write` and `write_dataframe` functions by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1107
* Add function to create or update a cube rule by jpcaparroz in https://github.com/cubewise-code/tm1py/pull/1116
* Fix 1126 and 1128 to allow `timeout` in `execute_process_with_return` function by ivankulman in https://github.com/cubewise-code/tm1py/pull/1127
* Add element `lock` and `unlock` functions by cubewise-gng in https://github.com/cubewise-code/tm1py/pull/1131
* Speed up `get_elements_dataframe` by vmitsenko in https://github.com/cubewise-code/tm1py/pull/1138
* Introduce mode for v12 auth with apikey by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1135
* Don't mutate passed df in hierarchy update function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1152
* Optional update attribute type feature by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1153
* Optional auto order df columns in `write_dataframe` function by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/1142
* CI Pipeline through GH Actions by nicolasbisurgi in https://github.com/cubewise-code/tm1py/pull/1157
* Fix: Improve version checks `FileService` by onefloid in https://github.com/cubewise-code/tm1py/pull/1165
* Fix 1174: Bug fix to compare and allow case and space insensitivity for `remove_edges_under_consolidation` by Mr-SabyasachiBose in https://github.com/cubewise-code/tm1py/pull/1177
* Add new auth mode: `access_token` for v12 in AKS by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1171
* Allow fast deletion of edges using blob by Mr-SabyasachiBose in https://github.com/cubewise-code/tm1py/pull/1185
* Make tests work with PAoC for gh action by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1187
* implement mpu file upload by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1190
* Unwind consolidations in hier update by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1188
* Refactor: Simplify parameter validation by onefloid in https://github.com/cubewise-code/tm1py/pull/1192
* Implement Lazy Initialization to Prevent Warnings for Deprecated Services by onefloid in https://github.com/cubewise-code/tm1py/pull/1169
* Drop MCSP from readme by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1194
* Use MPU by default on v12 by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1195
* Create empty files without mpu by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1198
* Fix 1181 `write_dataframe` case and space insensitive by cubewise-gng in https://github.com/cubewise-code/tm1py/pull/1204
* Fix `update_or_create_hierarchy_from_dataframe` fails when consolidation exists by cubewise-gng in https://github.com/cubewise-code/tm1py/pull/1207
* Fix 1151 element named `"None"` interpreted as `nan` in data frame by Cubewise-JoeCHK in https://github.com/cubewise-code/tm1py/pull/1159
* Added `ssl_context` param that allows custom ssl context for tm1 connection by AndreyKadysh in https://github.com/cubewise-code/tm1py/pull/1205
* Support paas MTLS certs to `RestService` by dataslaves in https://github.com/cubewise-code/tm1py/pull/1210
* Make level columns case insensitive by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1212
* Timezone in Seconds component corrected and format aligned to always include seconds by gtonkin in https://github.com/cubewise-code/tm1py/pull/1217
* Handle session-id through reverse proxy by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1223
* Add insert task function to chore by MrKiebitz in https://github.com/cubewise-code/tm1py/pull/1219

New Contributors
* Cubewise-Ronan made their first contribution in https://github.com/cubewise-code/tm1py/pull/1063
* onefloid made their first contribution in https://github.com/cubewise-code/tm1py/pull/1066
* jpcaparroz made their first contribution in https://github.com/cubewise-code/tm1py/pull/1116
* ivankulman made their first contribution in https://github.com/cubewise-code/tm1py/pull/1127
* Cubewise-JoeCHK made their first contribution in https://github.com/cubewise-code/tm1py/pull/1159
* AndreyKadysh made their first contribution in https://github.com/cubewise-code/tm1py/pull/1205
* dataslaves made their first contribution in https://github.com/cubewise-code/tm1py/pull/1210
* gtonkin made their first contribution in https://github.com/cubewise-code/tm1py/pull/1217
* MrKiebitz made their first contribution in https://github.com/cubewise-code/tm1py/pull/1219

**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/2.0...2.1

2.0

Highlights

1. Support for TM1 v12

TM1py now works with TM1 v12.

python
with TM1Service(
address="us-east-2.aws.planninganalytics.ibm.com",
api_key="AB4VfG7T8wPM-912uFKeYG5PGh0XbS80MVBAt7SEG6xn",
iam_url="https://iam.cloud.ibm.com/identity/token",
tenant="YA9A2T8BS2ZU",
database="Database") as tm1:
print(tm1.server.get_product_Version())

by rclapp in https://github.com/cubewise-code/tm1py/pull/1000

2. CRUD operations to manage servers on v12

python

with ManageService(domain=domain, root_client=root_client, root_secret=root_secret) as manager:
manager.create_database(instance_name="instance name",
database_name="database_name",
product_version="12.0.0",
number_replicas=1,
cpu_requests="1000m",
cpu_limits="2000m",
memory_limits="2G",
memory_requests="1G",
storage_size="20Gi")

manager.scale_database(instance_name="instance name", database_name="database name", replicas=2)

manager.create_database_backup(instance_name="instance name",
database_name="database name",
backup_set_name="my backup")


by rclapp

3. Asynchronous `execute_mdx` functions

Speed up your MDX executions by assigning more than one worker-thread in TM1.

python
mdx = """
SELECT
{TM1SubsetAll([Big Dimension])} ON ROWS,
{TM1SubsetAll([Small Dimension])} ON COLUMNS
FROM [Big Cube]
"""

with TM1Service(**tm1params) as tm1:
cells = tm1.cells.execute_mdx(
mdx=mdx,
leverage 4 worker threads in TM1 for the extraction
max_workers=4,
parallelization on rows axis
async_axis=1)


by vmitsenko in https://github.com/cubewise-code/tm1py/pull/935 and https://github.com/cubewise-code/tm1py/pull/1030


4. Hierarchy updates from data frames

Create and update TM1 hierarchies directly from pandas dataframes.

Stores | ElementType | Alias:a | City:s | Square Footage:n | level001 | level000 | level001_weight | level000_weight |
|:---------|:--------------|:-----------------|:--------------|-------------------:|:------------|:-----------|------------------:|------------------:|
S151 | Numeric | Boardwalk Games | New York City | 120 | USA | World | 1 | 1 |
S143 | Numeric | Strategy Vault | Zurich | 250 | Switzerland | World | 1 | 1 |
S811 | Numeric | Cardboard Castle | Sydney | 80 | Sydney | World | 1 | 1 |

python
columns = ["Stores", "ElementType", "Alias:a", "City:s", "Square Footage:n", "level001",
"level000", "level001_weight", "level000_weight"]
data = [
['S151', "Numeric", "Boardwalk Games", "New York City", 120, "USA", "World", 1, 1],
['S143', 'Numeric', "Strategy Vault", "Zurich", 250, "Switzerland", "World", 1, 1],
['S811', 'Numeric', "Cardboard Castle", "Sydney", 80, "Sydney", "World", 1, 1],
]

with TM1Service(**tm1params) as tm1:
tm1.hierarchies.update_or_create_hierarchy_from_dataframe(
dimension_name="Stores",
hierarchy_name="Stores",
df=DataFrame(data=data, columns=columns)
)



<img width="552" alt="image" src="https://github.com/cubewise-code/tm1py/assets/15182131/2b098efd-a375-47f1-94f9-4a50a0b0ea49">


by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/944 and https://github.com/cubewise-code/tm1py/pull/1011



New Features, Improvements, and Bugfixes


* Improve `get_elements_dataframe`with optional `use_blob` by MariusWirtz in 908 and https://github.com/cubewise-code/tm1py/pull/1040
* Allow spreading on `write` with `use_blob` & `use_ti` by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/909
* Add `proxies` arg to `TM1Service` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/911
* Show parameters on decorated functions in PyCharm by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/913
* Cater to breaking change in urllib3 2.0 release by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/918
* Fix wrong position brackets in `extract_cellset_raw` by vmitsenko in https://github.com/cubewise-code/tm1py/pull/923
* Add `keep_existing_attributes` to dimension update function to fix 922 by hermie64 in https://github.com/cubewise-code/tm1py/pull/924
* Enforce non-async request on project PUT to fix 872 by nicolasbisurgi in https://github.com/cubewise-code/tm1py/pull/925
* Add `get_edges_under_consolidation` Function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/927, https://github.com/cubewise-code/tm1py/pull/930
* Add method to delete elements by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/939
* Avoid failure on attempt to write empty cellset by rclapp in https://github.com/cubewise-code/tm1py/pull/947
* Delete multiple elements using TI by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/940
* Make JSON parsing for Chore more robust by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/950
* Make JSON parsing for NativeView more robust by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/955
* Remove temp view in `_execute_view_csv_use_blob` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/959
* Added clear view argument to write_through_blob by cubewise-gng in https://github.com/cubewise-code/tm1py/pull/964
* Add `arranged_axes` arg to `execute_view_csv` functions by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/961
* Allow optional weight columns on `get_elements_dataframe` function result by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/975
* Add new methods to expose cell partitioning by rclapp in https://github.com/cubewise-code/tm1py/pull/976
* Allow usage of `get_attribute_of_elements` function with numpy arrays by MBonotto in https://github.com/cubewise-code/tm1py/pull/987
* Add search function `search_error_log_filenames` for Process Error Log Filenames by adscheevel in https://github.com/cubewise-code/tm1py/pull/1004
* Include `clear_view` arg in `write_dataframe` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1012
* Add `replace_element` function to Hierarchy class by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1014
* Add `update_or_create` function in ElementService.py by yyzz1010 in https://github.com/cubewise-code/tm1py/pull/1018
* Add `allow_empty_alias` argument to `get_elements_dataframe` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1013
* Add `execution_path` property to `Chore` class by wimgielis in https://github.com/cubewise-code/tm1py/pull/1021
* Redesign legacy `require_admin` decorators to more granular `require_data_admin` etc. checks by adscheevel in https://github.com/cubewise-code/tm1py/pull/1016
* New `extract_cellset_axes_raw_async`, `extract_cellset_cell_async` and `extract_cellset_axes_cardinality` by vmitsenko in https://github.com/cubewise-code/tm1py/pull/957
* Add function `clear_with_dataframe` to clear cubes with dataframe https://github.com/cubewise-code/tm1py/issues/1006 by 151N3 in https://github.com/cubewise-code/tm1py/pull/1026, https://github.com/cubewise-code/tm1py/pull/1032
* Add function `get_values` by raeldor in https://github.com/cubewise-code/tm1py/pull/1020
* Fix issue on `restore_from_file` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1039
* Redesign TM1py services architecture by rclapp and adscheevel in https://github.com/cubewise-code/tm1py/pull/1042
* Substite nan attribute values with sensible values in `execute_mdx_dataframe` when `include_attributes` is `True` by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/1045
* Add `search_string_in_name` function to search for files in TM1 by adscheevel in https://github.com/cubewise-code/tm1py/pull/1049

Stats
- Contributors: 15
- Commits: 178
- Changed Files: 72
- Added Lines: 7,205
- Deleted Lines: 1,643

How to upgrade TM1py


pip install tm1py --upgrade


New Contributors
* vmitsenko made their first contribution in https://github.com/cubewise-code/tm1py/pull/923
* hermie64 made their first contribution in https://github.com/cubewise-code/tm1py/pull/924
* MBonotto made their first contribution in https://github.com/cubewise-code/tm1py/pull/987
* yyzz1010 made their first contribution in https://github.com/cubewise-code/tm1py/pull/1018
* wimgielis made their first contribution in https://github.com/cubewise-code/tm1py/pull/1021
* 151N3 made their first contribution in https://github.com/cubewise-code/tm1py/pull/1026


**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/1.11.1...2.0

1.11.3

Fixes

* Add `proxies` arg to `TM1Service` 911
* Show parameters on decorated functions in PyCharm e.g. `execute_mdx_dataframe` 913
* Cater to breaking in change in urllib3 2.0 release 918

1.11.1

What's Changed
* Fix encoding issue in `execute_mdx_dataframe` with `use_blob` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/904
* Issue/tcp keepalive by macsir in https://github.com/cubewise-code/tm1py/pull/902


**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/1.11...1.11.1

1.11

Highlights

1. Improved performance https://github.com/cubewise-code/tm1py/pull/882, https://github.com/cubewise-code/tm1py/pull/885

With this release TM1py makes better use of existing capabilities in the TM1 server to handle large read and write operations.

> The `write` function

Pass `use_blob=True` to the `write` or `write_dataframe` function to use the new optimized write mode.

python
with TM1Service(**params) as tm1:
cells = {
('Actual', 'Germany', 'T Series 4.0 L Sedan', 'Units', 'Jan'): 1500,
('Actual', 'Germany', 'T Series 4.0 L Sedan', 'Units', 'Feb'): 2100,
('Actual', 'Germany', 'T Series 4.0 L Sedan', 'Units', 'Mar'): 1100
}
tm1.cells.write("SalesCube", cells, use_blob=True)


On a sample of 1 million cell updates, this performs on par with Turbo Integrator and up to 6x faster than the previous `write` function. https://github.com/cubewise-code/tm1py/pull/882#issuecomment-1487440628

-----

> The `write_async` function

The `write_async` function now makes use of `use_blob` by default. The number of parallel worker threads in TM1 can be controlled through the `max_workers` argument. A reasonable value for `slice_size` needs to be provided.

E.g. if you are expecting 1 million cell updates, a reasonable choice would be `10` for `max_workers` and `100000` for `slice_size`.


python
with TM1Service(**params) as tm1:
tm1.cells.write_async(
cube_name="SalesCube",
cells=cells,
slice_size=100_000,
max_workers=10)


On a sample of 1 million cell updates, this performs ~5 times better than plain Turbo Integrator and ~5 times better than the previous `write_async` function. https://github.com/cubewise-code/tm1py/pull/882#issuecomment-1487440628

-----

> The `execute_mdx_dataframe`, `execute_view_dataframe` functions

Pass `use_blob=True` to the `execute_mdx_dataframe`, and `execute_view_dataframe` functions to use the new optimized read mode.

python
with TM1Service(**sdata_params) as tm1:
df = tm1.cells.execute_view_dataframe(cube_name="Sales Cube", view_name="Default", private=False, use_blob=True)


On large data sets this performs 20% to 40% better. It also reduces the memory footprint by ~70%. https://github.com/cubewise-code/tm1py/pull/885#issuecomment-1494983649



2. New `shaped` argument in the `execute_view_dataframe` function https://github.com/cubewise-code/tm1py/pull/893

Pass `shaped=True` to the `execute_mdx_dataframe`, and `execute_view_dataframe` functions to retrieve the data frame in the original shape of the cube view.

<img width="859" alt="image" src="https://user-images.githubusercontent.com/15182131/231799551-e6ce281e-0b4f-4d37-aa04-dfb9d0f53ffb.png">


python
with TM1Service(**sdata_params) as tm1:
df = tm1.cells.execute_view_dataframe(
cube_name="Sales Cube",
view_name="Default",
shaped=True,
use_blob=True)


| | account1 | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---:|:---------------|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|-----------:|
| 0 | Gross Margin% | 57.5155 | 56.4074 | 59.1279 | 59.5385 | 57.7353 | 57.1263 | 58.4302 | 59.7887 | 56.9305 | 56.9046 | 59.8059 | 56.2537 |
| 1 | Price | 19360 | 19532 | 19218.5 | 19631 | 19941 | 19870 | 19365 | 19216 | 19241 | 19099.5 | 19883.5 | 19432.5 |
| 2 | Units | 1 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 1 |
| 3 | Sales | 19.36 | 39.064 | 38.437 | 19.631 | 19.941 | 19.87 | 19.365 | 19.216 | 19.241 | 38.199 | 19.8835 | 19.4325 |
| 4 | Variable Costs | 8.225 | 17.029 | 15.71 | 7.943 | 8.428 | 8.519 | 8.05 | 7.727 | 8.287 | 16.462 | 7.992 | 8.501 |



_Please note the months on the columns in the table above_


3. Re-authenticate after session timeout https://github.com/cubewise-code/tm1py/pull/856

Now TM1py will re-authenticate and retry the operation once if the operation failed due to a session timeout.

This is helpful in situations where a TM1py script has been idle for a while and once it attempts to restart interaction with TM1 it fails due to a session timeout.

New Features, Improvements, and Bugfixes

* Fully support TM1 sandbox functionality by adscheevel in https://github.com/cubewise-code/tm1py/pull/844
* Support use of alternate hierarchies in `get_elements_dataframe` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/876
* Allow `dtype` to be inferred by pandas with argument `infer_dtype` in `execute_mdx_dataframe_shaped` by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/879

Acknowledgments
Big thanks to cwffonseca, Kevin-Dekker, and adscheevel for contributing code to this release, and many others for reporting bugs and requesting new features.

How to upgrade TM1py


pip install tm1py --upgrade


**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/1.10.2...1.11

1.10.2

What's Changed
* Implement `get_elements_dataframe` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/818 and https://github.com/cubewise-code/tm1py/pull/829
* Fix error in `execute_mdx_elements_value_dict` by meyersrl in https://github.com/cubewise-code/tm1py/pull/823
* add pyproject.toml / update gitignore by scrambldchannel in https://github.com/cubewise-code/tm1py/pull/826
* adding lamda expression to filter tuple by ldelberg in https://github.com/cubewise-code/tm1py/pull/831
* Create element attributes when creating hierarchy by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/833
* Add `uses_hierarchies` function to `DimensionService` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/821
* fix to tm1projecttask by nicolasbisurgi in https://github.com/cubewise-code/tm1py/pull/835
* Fix handling of `]` in element names in `execute_mdx` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/842

New Contributors
* meyersrl made their first contribution in https://github.com/cubewise-code/tm1py/pull/823
* ldelberg made their first contribution in https://github.com/cubewise-code/tm1py/pull/831

**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/1.10.1...1.10.2

Page 1 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.