Giter Site home page Giter Site logo

shvuuuu / dal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gmc2gmbh/dal

0.0 0.0 0.0 12 KB

The Data Access Layer (DAL) provides an interface based on TM1py. Using the DAL, efficient communication between the IBM Planning Analytics/TM1 REST API and Python can be realized.

License: MIT License

Python 100.00%

dal's Introduction

Data Access Layer

Data-driven innovation through the use of the Data Access Layer based on TM1py โค๏ธ

Python ibm

Install

copy the following files to your python development environment

  • DEV.yml
  • DAL.py

Configure the DEV.yml

planning_analytics:
    address: <url to your ibm planning analytics instance>
    port: <http-port>
    user: <username>
    password: <password>
    ssl: <boolean>

Use

import

from DAL import DataAccessLayer

instantiate the Data Access Layer with the DEV environment

DAL = DataAccessLayer(path='DEV.yml')

build example mdx-statement

mdx = {
    'columns':'{TM1FILTERBYLEVEL(TM1SUBSETALL([col.dim].[col.dim]) , 0)}',
    'rows':'{TM1FILTERBYLEVEL(TM1SUBSETALL([row.dim].[row.dim]) , 0)}',
    'where':[
        '[where.dim].[where.dim].[member]'
    ]
}

query = f"SELECT NON EMPTY {mdx['columns']} ON 0, NON EMPTY {mdx['rows']} ON 1 FROM [cube] WHERE ({','.join(mdx['where'])})"

Call the DAL request by MDX-Statement

data_raw = DAL.load_data_by_mdx(query)

Helper

convert pandas multi-index to standard pandas.DataFrame

data = data_raw.dropna()
data = data.unstack()
data = data.reset_index()
data.columns = data.columns.map(''.join)

Call the DAL request by View

data_raw = DAL.load_data_by_view(query)

Write dataframe

DAL.write_dataframe(cube="cube",dataframe=data)

Write cellset

DAL.write_cellset(cube="cube",cellset=data)

Run TI

DAL.run_ti(name="test",parameters={'pnValue':1234})

Features

DAL has more tricks up its sleeve than a magician's hat when it comes to getting cozy with TM1py, such as

  • Read data from TM1 via MDX and views as easy as possible
  • Write/Push data from outside into TM1
  • Easily configurable via YAML files
  • Significantly more interfaces of source/target systems can be connected (compared to TurboIntegrator) - e.g. OData
  • Core technology extending application
  • Secure and encrypted connection via SSL; data is not transferred in plain text
  • Data transfer from cloud to cloud using the authorization schema specified by the source and target system in each case

Requirements

  • Static Badge
  • Static Badge
  • Static Badge
  • Static Badge
  • Static Badge

Optional Requirements

  • Static Badge
  • Static Badge

Issues

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

Contribution

DAL is like a magical show, where everyone in the TM1 community can become a wizard! ๐Ÿง™โ€โ™‚๏ธ

If you happen to spot a pesky bug or have a spellbinding idea to enhance it, simply take your magical wand (fork the repository), weave your code incantations, and then conjure up a pull request. We'll be ready to merge in your enchanting contributions! โœจ๐Ÿช„

dal's People

Contributors

alexander-gusser avatar gmc2alg 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.