Code Monkey home page Code Monkey logo

tm1py's Introduction

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

  • 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

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

with TM1Service(
        address="us-east-2.aws.planninganalytics.ibm.com",
        api_key="AB4VfG7T8wPM-912uFKeYG5PGh0XbS80MVBAt7SEG6xn",
        iam_url="https://iam.cloud.ibm.com/identity/token",
        tenant="YA9A2T8BS2ZU",
        database="Database") 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())

Documentation

https://tm1py.readthedocs.io/en/master/

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.

tm1py's People

Contributors

mariuswirtz avatar adscheevel avatar scrambldchannel avatar rclapp avatar rkvinoth avatar josrobins avatar gbryant-dev avatar vviau avatar kevin-dekker avatar mariuswirtz-cubewise avatar ffonseca-dev avatar tobiaskapser avatar macsir avatar djhig avatar 151n3 avatar nicolasbisurgi avatar cubewise-gng avatar vmitsenko avatar karenwky avatar andreyea avatar kaleming avatar ldelberg avatar tomas1pit avatar pbuncik avatar raeldor avatar ykud avatar wimgielis avatar samuelko123 avatar zpat avatar mr-sabyasachibose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.