Skip to main content

PyPI - License PyPI - Version Pepy Total Downloads

TM1py is the python package for IBM Planning Analytics (TM1).

with TM1Service(address='localhost', port=8001, user='admin', password='apple', ssl=True) as tm1:
    subset = Subset(dimension_name='Month', subset_name='Q1', elements=['Jan', 'Feb', 'Mar'])
    tm1.subsets.create(subset, private=True)

Features

TM1py offers handy features to interact with TM1 from Python, such as

  • Functions to read data from cubes through cube views or MDX queries (e.g. tm1.cells.execute_mdx)
  • Functions to write data to cubes (e.g. tm1.cells.write)
  • Functions to update dimensions and hierarchies (e.g. tm1.hierarchies.get)
  • Functions to update metadata, clear or write to cubes directly from pandas dataframes (e.g. tm1.elements.get_elements_dataframe)
  • Async functions to easily parallelize your read or write operations (e.g. tm1.cells.write_async)
  • Functions to execute TI process or loose statements of TI (e.g. tm1.processes.execute_with_return)
  • CRUD features for all TM1 objects (cubes, dimensions, subsets, etc.)

Requirements

Optional Python Packages

  • pandas
  • networkx

Install

without pandas

pip install tm1py

with pandas

pip install "tm1py[pandas]"

Usage

TM1 11 on-premise

from TM1py.Services import TM1Service

with TM1Service(address='localhost', port=8001, user='admin', password='apple', ssl=True) as tm1:
    print(tm1.server.get_product_version())

TM1 11 on IBM cloud

with TM1Service(
        base_url='https://mycompany.planning-analytics.ibmcloud.com/tm1/api/tm1/',
        user="non_interactive_user",
        namespace="LDAP",
        password="U3lSn5QLwoQZY2",
        ssl=True,
        verify=True,
        async_requests_mode=True) as tm1:
    print(tm1.server.get_product_version())

TM1 12 PAaaS

from TM1py import TM1Service

params = {
    "base_url": "https://us-east-1.planninganalytics.saas.ibm.com/api/<TenantId>/v0/tm1/<DatabaseName>/",
    "user": "apikey",
    "password": "<TheActualApiKey>",
    "async_requests_mode": True,
    "ssl": True,
    "verify": True
}

with TM1Service(**params) as tm1:
    print(tm1.server.get_product_version())

TM1 12 on-premise & Cloud Pak For Data

with TM1Service(
        address="tm1-ibm-operands-services.apps.cluster.your-cluster.company.com",
        instance="your instance name",
        database="your database name",
        application_client_id="client id",
        application_client_secret="client secret",
        user="admin",
        ssl=True) as tm1:

    print(tm1.server.get_product_version())

TM1 12 on-premise with access token

params = {
    "base_url": "https://pa12.dev.net/api/<InstanceId>/v0/tm1/<DatabaseName>",
    "user": "8643fd6....8a6b",
    "access_token":"<TheActualAccessToken>",
    "async_requests_mode": True,
    "ssl": True,
    "verify": True
}

with TM1Service(**params) as tm1:
    print(tm1.server.get_product_version())

Documentation

https://tm1py.org/

Issues

If you find issues, sign up in GitHub and open an Issue in this repository

Contribution

TM1py is an open source project. It thrives on contribution from the TM1 community. If you find a bug or feel like you can contribute please fork the repository, update the code and then create a pull request so we can merge in the changes.

Release files for TM1py 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TM1py 2.4.0
File Size Uploaded
tm1py-2.4.0.tar.gz 180.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TM1py 2.4.0
File Interpreter ABI Platform
tm1py-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 389.4 kB

Release files / tm1py-2.4.0.tar.gz

Download URL tm1py-2.4.0.tar.gz
Size 180.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8125d2f477c3ac6c54d8f5b5b63d152e0febf6939d3cd9f73c99b57ba52809ae
BLAKE2b-256 checksum
How to use checksums
f446de8d520d9041eac7379a27fa4ae617215b161b925c68d75b35a1d5fe0d1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / tm1py-2.4.0-py3-none-any.whl

Download URL tm1py-2.4.0-py3-none-any.whl
Size 208.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7455b2cee8ea7a08d198fb19633d3921c8796f247027ba163fac050170dab92
BLAKE2b-256 checksum
How to use checksums
0c5e02d6e7c700a6eb7f9d6b9825875077021c5288f7544b782acb47effadb72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

2.4.1

2 release files

This release

2.4.0 This release

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2

1 release file

2.1

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0

1 release file

1.11.3

1 release file

1.11.2

1 release file

1.11.1

1 release file

1.11

1 release file

1.10.2

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.1

1 release file

1.9.0

1 release file

1.8.0

2 release files

1.7.0

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page