python

WHY NOT PYTHON ? TM1 through python

TM1py

In order to understand TM1py, lets understand what is py?

Py stands for Python. Python is an interpreted, object-oriented, general-purpose programming language with dynamic semantics. Its built-in data structures, combined with dynamic typing and dynamic binding, make it very attractive for rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the
extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.

Why use Python?

Python’s expansive library of open source data analysis tools, web frameworks, and testing
instruments make its ecosystem one of the largest out of any programming community. Python is an
accessible language for new programmers because the community provides many introductory
resources.

What is TM1py?

TM1py is a Python package that connects with TM1 REST API which make it simple to use library and build stuff with TM1 and Python.
With TM1py there are new possibilities to enhance your TM1 application, such as:

  1. Express complex calculations for TM1 with python
  2. Bring Data Science into the picture
  3. Go beyond TI
  4. Access TM1 data from other applications, such as PowerBI
  5. Control all TM1 objects from Python
  6. Load TM1 data into pandas for statistical analysis
  7. Load FX, Stock and GDP data from external sources into your cubes
  8. Synchronize cubes from different TM1 instances
  9. Clean your TM1 models through regular expressions
  10. Generate MDX Queries from existing cube views
  11. Analyse Processing Feeders time
  12. Maintain dimensions and subsets with python
    And so on…

Connecting TM1 with Python

1. Install Python

  • Select PIP (Package management system to install various packages)
  • Add Python path to Environmental Variables.

2. Enable TM1 REST API

  • Edit the tm1s.cfg file of the TM1 servers that you want to enable.
  • Add the entry HTTPPortNumber=####
  • Restart the TM1 servers.

3. Open cmd and type pip install TM1py

4. After install TM1py we need to import TM1py Services

  • Type> Python
  • Type> from TM1py.Services import TM1Service

5. After exporting TM1 services we need to create a connection with TM1 server.

  • Type> tm1=TM1Service (address=’localhost’, port=12354, user=’admin’, password=’apple’, ssl=True) {here tm1 is a variable created}
  • Type> print (tm1) {to check if connection has established}

Importing TM1 cube Data using Python

Below is the script to import TM1 data to csv format using Python and Pandas package. When working with tabular data, such as data stored in spreadsheets or database, pandas is the right tool. pandas will help to explore, clean and process data. In pandas, a data table is called a DataFrame.

Getting data using MDX
Note: Here I’m using juypter notebook to write and execute my script this can be written in python
native tool called IDLE or in CMD as well.
Cube Name
Executing above created MDX query

Note: Here I’m using juypter notebook to write and execute my script this can be written in python native tool called IDLE or in CMD as well.

34 thoughts on “WHY NOT PYTHON ? TM1 through python”
  1. What i do not understood is in reality how you’re now not
    really a lot more well-preferred than you may be
    now. You’re so intelligent. You recognize thus considerably relating to this matter, produced
    me individually imagine it from so many numerous
    angles. Its like men and women don’t seem to be interested except
    it’s one thing to do with Woman gaga! Your personal stuffs outstanding.

    All the time care for it up!

    Also visit my blog post; Joker688 online

  2. Wonderful blog you have here but I was curious about if you knew of any message
    boards that cover the same topics discussed here? I’d really like to be a
    part of group where I can get suggestions
    from other knowledgeable individuals that share the same interest.
    If you have any suggestions, please let me know. Thank you!

    Look into my blog … scr mega888

  3. Very nice post. I just stumbled upon your blog and wished to
    say that I’ve truly enjoyed surfing around your blog posts.
    After all I’ll be subscribing to your feed and I hope you
    write again very soon!

  4. You are so awesome! I don’t suppose I’ve truly read through anything like this before.
    So wonderful to find another person with some genuine thoughts
    on this subject. Seriously.. thanks for starting this up.
    This web site is one thing that’s needed on the web, someone with some originality!

    Also visit my site game lpe88

  5. Hmm it looks like your site ate my first comment
    (it was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.

    I too am an aspiring blog writer but I’m still
    new to the whole thing. Do you have any points for inexperienced
    blog writers? I’d really appreciate it.

    Have a look at my web site :: ace333 trusted company

  6. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post…

  7. Write more, thats all I have to say. Literally, it seems as though you relied
    on the video to make your point. You obviously know what youre talking about, why waste your intelligence
    on just posting videos to your weblog when you could be giving us something informative to read?

    Stop by my web blog :: kiosk 918kiss 2

  8. Great goods from you, man. I have understand your stuff previous to and you are just extremely great.
    I actually like what you have acquired here, really like what you’re stating
    and the way in which you say it. You make it entertaining and you
    still take care of to keep it smart. I can not wait to read
    much more from you. This is actually a terrific website.

    Also visit my blog free wallet casino malaysia

  9. That is really attention-grabbing, You are a very professional blogger.

    I have joined your rss feed and look ahead to searching for extra of your fantastic post.
    Additionally, I’ve shared your website in my social networks

    Take a look at my site :: 918kaya Company

  10. Hi, its fastidious piece of writing on the topic of media print, we all be aware of media is
    a fantastic source of data.

    Here is my webpage 918kiss plus trusted company (Milagro)

  11. Hello there I am so delighted I found your blog page, I really found you by error,
    while I was browsing on Aol for something else, Anyways I am here now and would just like to say many thanks for a remarkable post and a all round interesting blog (I also love
    the theme/design), I don’t have time to look over it all at the minute
    but I have saved it and also included your RSS feeds, so when I have time I will
    be back to read more, Please do keep up the superb job.

    my web blog: mega888 kiosk (Pete)

  12. Thanks for ones marvelous posting! I genuinely enjoyed
    reading it, you could be a great author.I will remember to bookmark your
    blog and will come back in the foreseeable future. I want to encourage one to continue your great job,
    have a nice weekend!

    my page – Game Xe888

  13. Definitely imagine that which you said. Your
    favourite justification seemed to be on the web the easiest factor to take note of.
    I say to you, I certainly get irked while people think about worries that they plainly don’t recognize about.
    You managed to hit the nail upon the top and also outlined out the
    entire thing with no need side effect , people
    could take a signal. Will likely be again to get more.
    Thanks

    Take a look at my website download game calibet

  14. We’re a bunch of volunteers and opening a new scheme in our community.
    Your site offered us with valuable information to work
    on. You have performed an impressive activity and our entire community will be grateful to
    you.

    Look into my site … sky777 11

  15. I’d have to examine with you here. Which is not one thing I usually do! I take pleasure in reading a post that may make folks think. Additionally, thanks for permitting me to comment!

  16. Hi , I do believe this is an excellent blog. I stumbled upon it on Yahoo , i will come back once again. Money and freedom is the best way to change, may you be rich and help other people.

  17. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post…

  18. Attractive section of content. I just stumbled upon your weblog and in accession capital to
    say that I get actually loved account your blog
    posts. Any way I will be subscribing in your feeds and even I achievement you get entry to consistently fast.

  19. Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across. It extremely helps make reading your blog significantly easier.

Leave a Comment