Tm1py

Latest version: v2.0.2

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

Scan your dependencies

Page 2 of 5

1.10.0

Highlights

> Performance improvements on all major TM1 I/O functions.

python
from TM1py import TM1Service

with TM1Service(address="", port=12354, ssl=True, user="admin", password="") as tm1:

df = tm1.cells.execute_view_dataframe(cube_name="Sales", view_name="Default", private=False)


| | Time | State | SalesMeasure | Value |
|----:|-------:|:--------|:---------------|------------:|
| 0 | 202001 | CA | Gross Margin | 13924.8 |
| 1 | 202001 | CA | Revenue | 41330.4 |
| 2 | 202001 | CA | COGS | 27405.6 |

python
from TM1py import TM1Service

with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:

cells = {
('Belgium', 'Actual', '2022', 'Apr', 'Revenue'): 10_000,
('Belgium', 'Actual', '2022', 'May', 'Revenue'): 15_000,
...
('Belgium', 'Actual', '2022', 'Jun', 'Revenue'): 20_000,
('Belgium', 'Actual', '2022', 'Apr', 'Revenue'): 45_000,
}

tm1.cells.write_async(cube_name="Sales", cells=cells, slice_size=32_000, max_workers=4,
measure_dimension_elements={'Revenue': 'Numeric'})



> Full support for TM1's git deployment functionality. Including the TM1Project and deployment definitions.

python

with TM1Service(address="", port=11247, ssl=True, user="admin", password="") as tm1:

project = TM1Project(name="Project Definition")

dev_deployment = TM1ProjectDeployment(
deployment_name="Dev",
settings={"ServerName": "dev"})

dev_deployment.add_task(TM1ProjectTask(
task_name="Security Refresh",
process="Bedrock.Security.Refresh"))

dev_deployment.include_all_attribute_dimensions(tm1)
dev_deployment.add_ignore(object_class="Cubes", object_name="*")

project.add_deployment(deployment=dev_deployment)

tm1.git.tm1project_put(project)


> New and more efficient ways to query and control elements and hierarchies.

python
from TM1py import TM1Service

with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:

break edge as one tiny atomic operation
tm1.elements.remove_edge(dimension_name="Region", hierarchy_name="Region", parent="EU", component="UK")

add new edge as one tiny atomic operation
tm1.elements.add_edges(dimension_name="Region", hierarchy_name="Region", edges={("Other", "UK"): 1})


python
from TM1py import TM1Service

with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:

is_parent = tm1.elements.element_is_parent(dimension_name="Region", hierarchy_name="Region", parent_name="Other",
element_name="UK")

is_ancestor = tm1.elements.element_is_ancestor(dimension_name="Region", hierarchy_name="Region",
element_name="Other", ancestor_name="UK")


> Heaps of miscellaneous features, optimizations and improvements that make your life easier when doing TM1 with Python.

python
from TM1py import TM1Service

with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1:

process_names = tm1.processes.search_string_in_code(search_string="Sunrise", skip_control_processes=True)


python
from TM1py import TM1Service

with TM1Service(base_url="https://localhost:12354", user="admin", password="apple") as tm1:

tm1.cubes.cube_save_data("Sales")



New Features and Improvements

* Fix in `set_time` function in `ChoreStartTime` class to allow 0 values by samuelko123 in https://github.com/cubewise-code/tm1py/pull/686
* Add `substitute_title` function to `MDXView` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/687
* Add `include_headers` argument to `extract_cellset_csv` function by to MariusWirtz in https://github.com/cubewise-code/tm1py/pull/689
* Add `remove_edge` function to `ElementService` to break individual parent-child relationship in one operation by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/693
* Fix bug to allow dimension creation from JSON file by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/698
* Improve performance of critical `build_cellset_from_pandas_dataframe` function by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/695
* Add `get_parents` function to `ElementService`. Allows retrieval of all parents for an element by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/699
* Fix doubled double quotes issue in element names by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/704
* Explicitly add elements to leaves hierarchy so solve 702 by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/703
* Handle duplicates in `write_dataframe` appropriately by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/708 & https://github.com/cubewise-code/tm1py/pull/712
* Accept `str` for `rules` update on `Cube` object by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/710
* New search function to find substrings in Rules or Processes (e.g., `search_string_in_code`) by adscheevel in https://github.com/cubewise-code/tm1py/pull/723
* Fix write failure for element names with `:` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/724
* Add `get_element_principal_name` function by MaaYuu in https://github.com/cubewise-code/tm1py/pull/731
* Add `get_ancestors`, `get_descendants` functions on `Hierarchy` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/732
* Read `'NA'` element name as a string instead of pandas `NaN` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/739
* Align float numbers intelligently when writing through unbound processes, to avoid "Number too big" TI errors during writeback, by pbuncik in https://github.com/cubewise-code/tm1py/pull/749
* Add functions to find views that contain a specified subset by adscheevel in https://github.com/cubewise-code/tm1py/pull/751
* Improve `write_async` performance by exposing `measure_dimension_elements` to `write_async` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/753
* Introduce `get_descendant_edges` function in `Hierarchy` class by skriptmeister42 in https://github.com/cubewise-code/tm1py/pull/760
* Fix the update function in `ApplicationService` to use the update operation instead of the delete and recreate approach, to avoid breaking existing references of the application by jrobinsonLOR in https://github.com/cubewise-code/tm1py/pull/762
* Implement `element_is_parent` and `element_is_ancestor` by rclapp in https://github.com/cubewise-code/tm1py/pull/767 and https://github.com/cubewise-code/tm1py/pull/771
* Allow queries with selection on more than 3 axes in the `execute_mdx` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/777
* Add support for `trace_cell_calculation`, `trace_cell_feeders`, and `check_cell_feeders` by rclapp in https://github.com/cubewise-code/tm1py/pull/780
* Add function `create_many` in AnnotationService to create many annotations in one operation by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/785
* Add new element functions like `get_consolidated_elements`, `get_parents_of_all_elements` by adscheevel in https://github.com/cubewise-code/tm1py/pull/792
* Adjust TM1py to changes in mdxpy 0.4 by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/793
* Handle `TM1Project` in the `GitService` by nicolasbisurgi in https://github.com/cubewise-code/tm1py/pull/775 and https://github.com/cubewise-code/tm1py/pull/796
* Refactor Breakpoints and introduce new debugging functionality by adscheevel in https://github.com/cubewise-code/tm1py/pull/791
* Allow alternative separators for elements in `get_value` and other functions by tobiaskapser in https://github.com/cubewise-code/tm1py/pull/801 and https://github.com/cubewise-code/tm1py/pull/805
* Use 100k max statements in `write` function with `use_ti=True` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/808
* Enable TCP keepalive option for long run requests by macsir in https://github.com/cubewise-code/tm1py/pull/807
* Additional features in `ServerService` : `CubeSaveData` and `DeleteAllPersistentFeeders` by Mr-SabyasachiBose in https://github.com/cubewise-code/tm1py/pull/810

New Contributors

* samuelko123 made their first contribution in https://github.com/cubewise-code/tm1py/pull/686
* Kevin-Dekker made their first contribution in https://github.com/cubewise-code/tm1py/pull/695
* MaaYuu made their first contribution in https://github.com/cubewise-code/tm1py/pull/731
* pbuncik made their first contribution in https://github.com/cubewise-code/tm1py/pull/749
* skriptmeister42 made their first contribution in https://github.com/cubewise-code/tm1py/pull/760
* jrobinsonLOR made their first contribution in https://github.com/cubewise-code/tm1py/pull/762
* nicolasbisurgi made their first contribution in https://github.com/cubewise-code/tm1py/pull/775
* tobiaskapser made their first contribution in https://github.com/cubewise-code/tm1py/pull/801
* Mr-SabyasachiBose made their first contribution in https://github.com/cubewise-code/tm1py/pull/810


How to upgrade TM1py

To upgrade TM1py, just use the following command:


pip install TM1py --upgrade
`

**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/1.9.0...1.10.0

1.9.0

Highlights

> New optional `use_iterative_json` parameter in `execute_mdx_dataframe`/`execute_view_dataframe` functions https://github.com/cubewise-code/tm1py/pull/646, https://github.com/cubewise-code/tm1py/pull/612

This new feature allows TM1py to use [iterative JSON parsing](https://pypi.org/project/ijson/).

When `use_iterative_json` is `True` TM1py requires a significantly smaller memory footprint _(down to ~ 20% of the original value)_ at an almost negligible cost of performance _(single percentage digit)_:

python
from TM1py import TM1Service

with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:

df = tm1.cells.execute_view_dataframe(cube_name="Sales", view_name="Very Large View", private=False,
use_iterative_json=True)


This is a handy feature when dealing with large or very large data volumes _(1M to 10M cells)_ in an environment with limited RAM.

> New `skip_non_updateable` argument in `write`/`write_dataframe` functions https://github.com/cubewise-code/tm1py/pull/657

This optional argument to the `write`/`write_dataframe` functions asks TM1py to filter out cells that can not be updated before attempting to write. If not used, TM1py will fail with an error when attempting to write to rule-derived or consolidated cells.

python
from TM1py import TM1Service

with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:

cells = {
('Belgium', 'Revenue', '2022', 'Apr', 'Revenue'): 10_000,
('Belgium', 'Revenue', '2022', 'May', 'Revenue'): 15_000,
('Belgium', 'Revenue', '2022', 'Jun', 'Revenue'): 20_000,
('Belgium', 'Revenue', '2022', 'Q1', 'Revenue'): 45_000,
}

tm1.cells.write("Sales", cells, skip_non_updateable=True)


This is a useful feature, as it saves the TM1py user from verifying the validity of the cell updates yourself when not working with flawless data sources.
Only errors w.r.t. updatability are suppressed! Attempts, for instance, to write to not existing elements will still raise errors.

> New `search` functions to search through cubes, processes, and chores 660, 663, 665

python
from TM1py import TM1Service

with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:

processes = tm1.processes.search_string_in_code(search_string="Sales")



python
from TM1py import TM1Service

with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:

processes = tm1.processes.search_string_in_name(name_contains="Sales")


python
from TM1py import TM1Service

with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:

cubes = tm1.cubes.search_for_dimension(dimension_name="Product", skip_control_cubes=True)





New Features
- add `write to_message_log_function` 621
- allow `skip_zeros` in `execute_mdx_values` function 659
- use python built-in csv module to create csv strings in `execute_mdx_csv` function 678
- new `rename` function in `ApplicationService` 682
- support `compact_json` in some `execute_mdx_` functions 650

Improvements and Bugfixes

- `get_last_message_from_processerrorlog` to return text ac0d72f2318077b26134c7e9dc02f3833d7d6391
- raise exception when session creation fails a42753efd089f8179213596f0ce38001d53822c0
- don't raise error if cellset is already deleted 3246391470a81215a5d47ec24a3a2d4e85529f64
- improve `execute_set_mdx` function 61fe2ea8f06caf55ecb9f34025425e86f7ebacde
- add `update_or_create` function for document from file 7f94f712c0377391c069f817081483dca7351ecc
- drop obsolete arguments in `TM1Service` constructor 652
- support attribute type change 664
- fix `get_values` function issue to work with alternate hierarchies seamlessly 680
- improve handling of alternate hierarchies in `write` function 679
- optional `measure_dimension_elements `dictionary argument to `write` and `write_dataframe` function to improve performance b21ac47ce8ee9c990aae269e5594c1a342cd0021

Acknowledgments

Big thanks to rkvinoth, jrobinsonAG, gbryant-dev, raeldor, adscheevel, jordanjeremy for contributing code to this release, and many others for reporting bugs and requesting new features.

How to upgrade TM1py

To upgrade TM1py, just use the following command:


pip install TM1py --upgrade
`

1.8.0

Highlights

- Support MDX properties in `execute_mdx_dataframe`.
This allows to query data and attribute data with a single query into one shared data frame.

python
from TM1py import TM1Service

with TM1Service(address="", port=12354, user="admin", password="apple", ssl=True) as tm1:
mdx = """
SELECT
{Tm1SubsetAll([Region])} PROPERTIES [Region].[Currency] ON COLUMNS,
{Tm1SubsetAll([Year])} ON ROWS
FROM [Sales]
"""

data = tm1.cells.execute_mdx_dataframe(mdx, include_attributes=True)


| | Year | Region | Currency | Value |
|---:|:----------|:------|:----------------------|--------:|
| 0 | 2021 | US | USD | 18 |
| 1 | 2021 | UK | GBP | 4 |


- `write_async` and `write_async_dataframe` functions with `max_workers` argument.
This is essentially an easy way to speed up TM1 writeback through parallelization.

python
from TM1py import TM1Service

with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
cells = {
('e1', 'e1'): 1,
('e1', 'e2'): 2,
('e2', 'e1'): 3,
('e2', 'e2'): 4,
('e3', 'e1'): 5,
('e3', 'e2'): 6,
}

tm1.cells.write_async(cube_name="c1", cells=cells, slice_size=1, max_workers=6)



python
from pandas import DataFrame

from TM1py import TM1Service

with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
data = DataFrame({
'd1': ['e1', 'e1', 'e2', 'e2', 'e3', 'e3'],
'd2': ['e1', 'e2', 'e1', 'e2', 'e1', 'e2'],
'value': [1, 2, 3, 4, 5, 6],
})

tm1.cells.write_dataframe_async(cube_name="c1", data=data, slice_size_of_dataframe=1, max_workers=6)



- TM1 git support 447
TM1py now allows you to manage the TM1 git repository. You can manage the TM1 database with git and TM1py.

- New authentication mode based on `cam_passport`. Can be used from Jupyter within Cognos Analytics.

python
from ca_data_connector.ca_lib import OnPremSession

session = OnPremSession()
session.initialize()
passport = session.get_cookies()['cam_passport']

with TM1Service(address=address, port=port, ssl=ssl, cam_passport=passport) as tm1:
print(tm1.server.get_server_name())



New Features

- AuditLog queries 3771dad
- Changes to `tm1.power_bi.execute_mdx` function to provide data to PBI in the most friendly way 476
- Improvement on PowerBI dimension retrieval function to fetch attribute for a parent instead of parent element name 478
- Support `MDX PROPERTIES` in `execute_mdx_dataframe` 470
- Introduce a new `cancel_at_timeout` argument to abort TM1 operation once the `timeout` is reached
- Support process debugging a83da11
- New arguments on `execute_mdx`, `execute_view`: `skip_cell_properties`, `element_unique_names` to control shape of response dictionary f751edf, 6d9e520
- TM1 git support 447
- New `write_dataframe_async` function 94081eb
- New `write_async` function 3969c1d
- Create, read, update, delete servers on admin host 296
- New `re_authenticate` function in TM1Service 2028d3d
- Better delta log requests aeed032
- Allow login with `cam_passport` f070c06

Fixes

- Never attempt to delete leaves hierarchy a0aa152
- Make install with pandas work with zsh c458e40
- Fix encoding of ui-data property 6438309
- Fix deactivate / activate chore 515
- Accept float as `timeout` 2d0c555
- Fix is_admin property in User class d9ed1b2
- Fix documentation on [readthedocs](https://tm1py.readthedocs.io/en/latest/)
- Remove linebreaks when writing with ti 568
- Include empty strings suppression in `extract_cellset_raw` 01eb4a7
- Allow parameters on unbound processes 144db38
- Improve `kwargs` delegation through call stack ee70f54
- Allow `WITH MEMBERS` combined with `include_attributes=True` in `execute_mdx_dataframe` function 593
- Allow `WITH MEMBERS` combined with `display_attribute=True` in `execute_mdx_dataframe_shaped` function 593
- Skip sandbox dimension in `cubes.get` 595

Acknowledgments

Big thanks to lapstue, kaleming, beckyconning, macsir, jrobinsonAG, tomasfelcman, cwffonseca for contributing code to this release, and many others for reporting bugs and requesting features.

How to upgrade TM1py

To upgrade TM1py, just use the following command:


pip install TM1py --upgrade
`

1.6.0

Highlights

- support for IntegratedSecurityMode3

python
tm1 = TM1Service(address=servername, port=instanceport, ssl=True, integrated_login=True)


- faster write function
python
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
cells = dict()
cells["e1", "e1"] = 1
cells["e2", "e2"] = 2

tm1.cells.write("c1", cells, use_ti=True)


- new `write_dataframe` function https://github.com/cubewise-code/tm1py/commit/82a39bd1cbe1861706430caa469d7c2b97c14dda

python
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
df = pd.DataFrame({
'd1': ['e1', 'e2'],
'd2': ['e1', 'e2'],
'Value': [1, 2]})

tm1.cells.write_dataframe('c1', df)

- support for sandboxes

python
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
sandbox = Sandbox(name="My Sandbox")
tm1.sandboxes.create(sandbox)


python
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
cube_name = 'c1'
cells = {
("e1", "e1"): 1,
("e2", "e2"): 2
}
tm1.cells.write(cube_name, cells, sandbox_name="My Sandbox")


python
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
mdx = """
SELECT
{[d1].[e1], [d1].[e2]} ON ROWS,
{[d2].[e1], [d2].[e2]} ON COLUMNS
FROM [c1]
"""
df = tm1.cells.execute_mdx_dataframe(mdx, sandbox_name="My Sandbox")


- impersonation 353

python
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple", impersonate="Marius") as tm1:
print(tm1.whoami)


New Features

- new query options on `filter_message_log` function: `level`, `msg_contains` https://github.com/cubewise-code/tm1py/commit/e9c27150e7fd82f8f178d1709e27909b0b43c2f3
- new direct functions to add elements, edges or element attributes quickly: `add_elements`, `add_edges`, `add_element_attributes`
- new security functions: `get_read_only_users`, `get_custom_security_groups`, `update_user_password` 393
- functions to start and stop performance monitor: `start_performance_monitor`, `stop_performance_monitor`
- new `cube_lock`, `cube_unlock` functions https://github.com/cubewise-code/tm1py/commit/8ea00963227056b7996d4664ce0ed6f46d1b45f4
- new `remove_edges_under_consolidation` function https://github.com/cubewise-code/tm1py/commit/e5d287652954f70cc3c7409f53dcd32b26de3f86
- new `get_elements_by_wildcard` function https://github.com/cubewise-code/tm1py/commit/e4837dca03e38095ec2fef8ce8e347c9465838b6
- add `remove_all_elements`, `remove_all_edges` function to hierarchy class
- optional `increment` argument in `write` function
- Add `add_component` function to Hierarchy class
- support for changesets in write operations 454

Fixes

- improved test suite 301
- fix `get_number_of_elements` function
- fix `get_members_under_consolidation` 381
- make `get_attribute_of_elements` work with numeric attributes https://github.com/cubewise-code/tm1py/commit/39d61fed29c84df5edd14e7b8f893da03bb6871e
- avoid execute_dataframe method to fail over 0 cell https://github.com/cubewise-code/tm1py/commit/74509111648f141cea245f5c5cd3af58aa02f472
- implement `__sub__` function in `CaseAndSpaceInsensitiveSet` https://github.com/cubewise-code/tm1py/commit/8c807e7ea05dc4b3f965d3d0125c79495b96b994
- issue in `get_last_data_update` function https://github.com/cubewise-code/tm1py/commit/9bc898e6c0c6a8510c8da1729dda978e47fa1279
- Fix single-axis selection issue in execute_mdx 416
- work around TM1 REST issue with RuleDerived cell property https://github.com/cubewise-code/tm1py/commit/b5d4bd87cd37aabcc6f205c736bc1ab4267d82e7
- Fix chore reschedule issue cubewise-code/tm1py-samples82

Compatibility Notes
- requires Python 3.7 or higher
- `execute_mdx_values` now returns a list object instead of a generator
- the `MDXUtils` module has been removed. Use [mdxpy](https://github.com/cubewise-code/mdxpy) instead
- `write_values` now returns the `changeset_id` instead of a response object


Acknowledgments

Big thanks to rkvinoth, scrambldchannel, andreyea, adscheevel, rclapp, wimgielis for contributing code to this release, and many others for reporting bugs and requesting features.


How to upgrade TM1py
To upgrade TM1py, just use the following command:


pip install TM1py --upgrade
`

1.5.0

Highlights


- Functions to pull TM1 data into PowerBI in a convenient shape. Allows building dashboards in PowerBI Desktop with refreshable TM1 data.

![pbi2](https://user-images.githubusercontent.com/15182131/89424639-55739500-d738-11ea-9067-baf06d8e4da7.gif)

The `execute_mdx` and `execute_view` functions retrieve data from a cube.

python
with TM1Service(address="localhost", port=12354, user="admin", password="apple", ssl=True) as tm1:
data = tm1.power_bi.execute_view(cube_name="Sales", view_name="PowerBI", private=False)


| | Time | Industry | Executive | Customer | Business Unit | Product | State | Gross Margin | Revenue | COGS |
|----:|-------:|:-----------------|:---------------|-----------:|----------------:|----------:|:--------|---------------:|-----------:|----------:|
| 0 | 201308 | CPG | Andrew Ma | 10008 | 49 | 30 | TX | -5048.78 | nan | 5048.78 |
| 1 | 201308 | CPG | Andrew Ma | 10017 | 49 | 30 | NY | -5821.12 | nan | 5821.12 |
| 2 | 201308 | Energy | Valery Ushakov | 10035 | 31 | 50 | OH | -60384.4 | nan | 60384.4 |
| 3 | 201308 | Energy | Carlos Grilo | 10026 | 48 | 20 | FL | -24880 | nan | 24880 |


The `get_member_properties` function retrieves a slice of a dimension.

python
with TM1Service(address="localhost", port=12354, user="admin", password="apple", ssl=True) as tm1:

customers = tm1.power_bi.get_member_properties(
dimension_name="Customer",
hierarchy_name="Customer",
member_selection="{Tm1SubsetAll([Customer])}",
skip_consolidations=True,
attributes=["State", "City"],
skip_parents=False)


| | Customer | Type | State | City | level000 |
|----:|:-----------|:--------|:--------|:-------------------------|:---------------|
| 0 | 1023 | Numeric | TX | Irving | Total Customer |
| 1 | 10000 | Numeric | IL | Chicago | Total Customer |
| 2 | 10001 | Numeric | IL | Westchester | Total Customer |
| 3 | 10002 | Numeric | TX | Plano | Total Customer |
| 4 | 10003 | Numeric | TX | Fort Worth | Total Customer |

- New `clear` method to efficiently zero out a slice of a cube, without need to write an MDX query or create a cube view.
python
with TM1Service(address="localhost", port=12354, user="admin", password="apple", ssl=True) as tm1:

tm1.cells.clear(cube="Sales", state="{[State].[CA]}", time="{[Time].[2020].Children}")


![clear](https://user-images.githubusercontent.com/15182131/89426509-894fba00-d73a-11ea-9c2e-c68da778c65f.gif)

- Python Type Hints are now available on all functions and arguments. This enables autocompletion on all TM1py objects and makes working with TM1py way more friendly.

![type_hints2](https://user-images.githubusercontent.com/15182131/89415071-a7fa8480-d72b-11ea-9aff-00145cdf455f.gif)

- New `async_requests_mode` to avoid 60s timeout when using TM1py with the IBM cloud 241
python
with TM1Service(
base_url='https://hostname.planning-analytics.ibmcloud.com/tm1/api/tm1_database_name/',
user="user",
namespace="LDAP",
password="xxxx",
ssl=True,
verify=True,
async_requests_mode=True) as tm1:

print(tm1.server.get_product_version())



- Added functions to `MonitoringService` to clear a TM1 instance from all user traffic
- `cancel_all_threads`
- `close_all_sessions`
- `disconnect_all_users`

New Features
- New function `execute_set_mdx` in `ElementService` allows to execute MDX set expressions. 205
- Add `add_edges` method to HierarchieService
- Support execution of unbound TI processes 220
- Added `update_or_create` methods to all services
- Added plain `clear_with_mdx` method to `CellService`
- Cube dimension re-order function `update_storage_dimension_order` now returns the percent change in memory footprint
- Added `get_element_names` method to `SubsetService` to retrieve element names from static or dynamic subsets
- Added `user_exists`, `group_exists` function to `SecurityService`
- Improved performance in `build_cellset_from_pandas_dataframe` function
- Add `skip` argument to all `execute_view_`, `execute_mdx_` functions
- New `make_static` function in SubsetService 262
- Allow filtering of messagelog and transactionlog with `since` and `until` timestamps 268
- Add `skip_zeros`, `skip_consolidated`, `skip_rule_derived` arguments to all `execute_mdx` and `execute_view` functions 273
- New simplified function in `ElementService` to retrieve elements with one attribute as dictionary: `get_attribute_of_elements`
- New function `execute_mdx_elements_value_dict` allows to retrieve data in dictionary with comma seperated element names as the key
- New function `clear_spread` in CellService allows to execute a clear spread based on list unique element names. 207
- Support individual timeout on function call 117

Bug Fixes
- Fix timeout type issue 217
- Fix redundant calls in dimension update and create methods 229
- New improved `format_url` method to properly encode special characters in TM1 object names 212
- Add `type` and `enabled` as properties to `User` class
- Fix issue in `dst_chore_time`
- Fix issue in `extract_cellset_dataframe`
- Replace unofficial `/Content` REST API calls with official API calls 273
- Fix`check_rules` function to behave in line with `compile_process` function 277
- Encode % properly in object names 285

Compatibility Notes
By default, pandas will no longer be installed when installing TM1py with pip. 214

If you want to install tm1py with pandas, run:

pip install tm1py[pandas]


If a function requires pandas, but it isn't installed, TM1py will throw an `ImportError`:

ImportError: Function 'get_member_properties' requires pandas


The `MDXUtils` module has been deprecated. It still works but it throws a warning. It will be removed in the next major release of TM1py.
Please use [MDXpy](https://github.com/cubewise-code/mdxpy) instead.

Acknowledgments

Big thanks to rkvinoth, scrambldchannel, rclapp, ykud, zPat for contributing code to this release, and many others for reporting bugs and requesting features.

How to upgrade TM1py
To upgrade TM1py, just use the following command:


pip install TM1py --upgrade
`

1.4.1

New Features
- new methods in `ElementService`: `get_number_of_elements`, `get_number_of_consolidated_elements`, `get_number_of_leaf_elements`

Bugfixes
- restrict escaping of single quotes in url to object names only
- Fix for 124

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.