If your TM1 environment still relies on Windows batch files and ExecuteCommand scripts to trigger data loads, you are sitting on technical debt that will eventually break. When files lock or network drives disconnect, batch scripts fail silently without returning error details to your finance team.
There is a much cleaner way to automate IBM Planning Analytics. By connecting Python to the official TM1 REST API using the open-source TM1py library, you can build reliable automation that handles logins securely, logs exact error lines, and transfers data without intermediate CSV dumps.
For decades, TM1 developers used ExecuteCommand in TurboIntegrator to run .bat or PowerShell scripts on the host Windows server. While this worked on old local machines, it introduces three major operational headaches:
ExecuteCommand as an asynchronous fire-and-forget call. If the batch script crashes halfway through, TM1 logs a generic success code because the command prompt started.IBM introduced the TM1 REST API to give developers full programmatic control over the TM1 server. Everything you can do inside Architect or Planning Analytics Workspace can be done via standard HTTPS requests:
Writing raw HTTP requests against OData endpoints can be tedious. That is why the TM1 community created TM1py, a clean Python wrapper maintained by Cubewise that handles authentication, JSON serialization, and connection pooling automatically.
You can install TM1py in your Python environment with a single command:
pip install TM1py
Here is a complete, production-ready Python script that logs into TM1 securely, executes a TurboIntegrator chore, checks for errors, and queries cell data:
from TM1py.Services import TM1Service
from TM1py.Exceptions import TM1pyException
# Connect securely to TM1 over HTTPS
tm1_config = {
'address': 'tm1server.company.com',
'port': 8001,
'ssl': True,
'user': 'svc_finance_automation',
'password': 'SecureVaultPassword123!',
'namespace': 'LDAP'
}
try:
with TM1Service(**tm1_config) as tm1:
print("Connected to TM1 Server version:", tm1.server.get_product_version())
# 1. Execute a TurboIntegrator Process with Parameters
process_name = "Finance.Actuals.ImportFromERP"
params = {"pYear": "2026", "pMonth": "09"}
success, status, error_log_file = tm1.processes.execute_with_return(process_name, **params)
if success:
print(f"Process {process_name} completed successfully!")
else:
print(f"Process failed with status: {status}")
if error_log_file:
print(f"Error log file generated: {error_log_file}")
# 2. Extract Cube Summary Data
cube_name = "General Ledger"
value = tm1.cubes.cells.get_value(
cube_name=cube_name,
elements="2026,Sep,Actual,Net Profit,Total Company,Local Currency"
)
print(f"September 2026 Net Profit: ${value:,.2f}")
except TM1pyException as e:
print("TM1 Operation Error:", str(e))
except Exception as ex:
print("Unexpected Connection Error:", str(ex))
Once your Python script is tested, you can orchestrate it using modern tools rather than brittle local schedulers:
Before moving your Python automation to production, review this five-point readiness check:
Tired of fragile batch scripts and middle-of-the-night data load failures? The team at Octane Software Solutions helps enterprise finance teams build resilient, automated TM1 architectures. Talk to our TM1 engineers today.