Skip to main content

A python module for TM1.

Project description

By wrapping the IBM Planning Analytics (TM1) REST API in a concise Python framework, TM1py facilitates Python developments for TM1.

Interacting with TM1 programmatically has never been easier.

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

  • Read data from cubes through cube views and MDX Queries
  • Write data into cubes
  • Execute processes and chores
  • Execute loose statements of TI
  • CRUD features for TM1 objects (cubes, dimensions, subsets, etc.)
  • Query and kill threads
  • Query MessageLog, TransactionLog and AuditLog
  • Generate MDX Queries from existing cube views

Requirements

  • python (3.7 or higher)
  • requests
  • requests_negotiate_sspi
  • TM1 11

Optional Requirements

  • pandas

Install

without pandas

pip install tm1py

with pandas

pip install "tm1py[pandas]"

Usage

on-premise

from TM1py.Services import TM1Service

with TM1Service(address='localhost', port=8001, user='admin', password='apple', ssl=True) as tm1:
    for chore in tm1.chores.get_all():
        chore.reschedule(hours=-1)
        tm1.chores.update(chore)

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:
    for chore in tm1.chores.get_all():
        chore.reschedule(hours=-1)
        tm1.chores.update(chore)

Samples: https://github.com/cubewise-code/TM1py-samples

Documentation

Detailed Installation instructions and Samples: https://github.com/cubewise-code/TM1py-samples

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TM1py-1.8.0.tar.gz (87.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TM1py-1.8.0-py2.py3-none-any.whl (110.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file TM1py-1.8.0.tar.gz.

File metadata

  • Download URL: TM1py-1.8.0.tar.gz
  • Upload date:
  • Size: 87.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

File hashes

Hashes for TM1py-1.8.0.tar.gz
Algorithm Hash digest
SHA256 308bd5c9dfd936aee87ac5b21b0f19a7db5d8e7b9b2b997c1aea6e0930a8f4ea
MD5 14bfd33be38850321c430aa442150c24
BLAKE2b-256 653ec1594edd4ab2a8f110947087871c949c2cde8391fccb1ec02771eeca36b0

See more details on using hashes here.

File details

Details for the file TM1py-1.8.0-py2.py3-none-any.whl.

File metadata

  • Download URL: TM1py-1.8.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 110.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7

File hashes

Hashes for TM1py-1.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 08e81ae8539a1d9bc10f3503dd6469aa4920f0a4d42c92f16d31575d5a4d4fb5
MD5 5ae6971a9c51d01cd5c0eacc09e5a56a
BLAKE2b-256 e854263cb34baedd15d39de2db2d22de43d288a22f089e4f140b07ea4c88017b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page