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.
The execute_mdx
and execute_view
functions retrieve data from a cube.
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.
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.
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}")
- 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.
- New
async_requests_mode
to avoid 60s timeout when using TM1py with the IBM cloud #241
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 trafficcancel_all_threads
close_all_sessions
disconnect_all_users
New Features
- New function
execute_set_mdx
inElementService
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 toCellService
- Cube dimension re-order function
update_storage_dimension_order
now returns the percent change in memory footprint - Added
get_element_names
method toSubsetService
to retrieve element names from static or dynamic subsets - Added
user_exists
,group_exists
function toSecurityService
- Improved performance in
build_cellset_from_pandas_dataframe
function - Add
skip
argument to allexecute_view_
,execute_mdx_
functions - New
make_static
function in SubsetService #262 - Allow filtering of messagelog and transactionlog with
since
anduntil
timestamps #268 - Add
skip_zeros
,skip_consolidated
,skip_rule_derived
arguments to allexecute_mdx
andexecute_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
andenabled
as properties toUser
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 withcompile_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 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