Highlights
Performance improvements on all major TM1 I/O functions.
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 |
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.
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.
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})
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.
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)
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
Source code(tar.gz)
Source code(zip)