Quick Summary: Replace fragile Windows batch files and ExecuteCommand scripts with clean Python automation. Connecting TM1py to the official TM1 REST API delivers encrypted HTTPS logins, real-time error logging, and direct in-memory cube queries without intermediate CSV dumps.
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 simply because the command prompt launched.
cmd.exe) and local drive mappings do not exist.
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 now be orchestrated 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 terminal command:
Here is a complete, production-ready Python script that logs into TM1 securely over HTTPS, executes a TurboIntegrator process with parameters, evaluates the return status, 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 in Real Time 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:
Chain your TM1 data load after your Snowflake or ERP transformation completes, ensuring TM1 never loads partial or unverified datasets.
Run your scripts serverless on a recurring schedule without keeping a dedicated Windows virtual machine powered on 24/7.
Pull API credentials directly from Azure Key Vault or AWS Secrets Manager so zero passwords or service account tokens live on disk.
Before moving your Python automation into production, review this five-point readiness checklist:
Tired of fragile batch scripts, locked network folders, 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 →
Subject-matter specialist at Octane Solutions, helping Australian enterprise finance teams optimize planning, analytics, and automation.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Leave a comment