<img src="https://s3-ap-southeast-2.amazonaws.com/downloads.cubewise.com/web_assets/CubewiseLogos/TM1py-logo.png" style="width: 70%; height: 70%;text-align: center"/>
TM1py is the python package for IBM Planning Analytics (TM1).
``` python
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, TM1 12
- keyring
Optional Requirements
=======================
- pandas
Install
=======================
> without pandas
pip install tm1py
> with pandas
pip install "tm1py[pandas]"
> keyring
pip install keyring
Usage
=======================
> TM1 11 on-premise
``` python
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
``` python
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 MCSP
``` python
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 PAaaS
``` python
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
``` python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/cubewise-code/tm1py",
"name": "TM1py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "TM1, IBM Cognos TM1, Planning Analytics, PA, Cognos",
"author": "Marius Wirtz",
"author_email": "MWirtz@cubewise.com",
"download_url": "https://files.pythonhosted.org/packages/14/e9/3069687a0a6bf7ff51f93b8b116b150c558d1b05e3a460f6efc1771fcca6/tm1py-2.0.4.tar.gz",
"platform": null,
"description": "\r\n<img src=\"https://s3-ap-southeast-2.amazonaws.com/downloads.cubewise.com/web_assets/CubewiseLogos/TM1py-logo.png\" style=\"width: 70%; height: 70%;text-align: center\"/>\r\n\r\n\r\nTM1py is the python package for IBM Planning Analytics (TM1).\r\n\r\n``` python\r\nwith TM1Service(address='localhost', port=8001, user='admin', password='apple', ssl=True) as tm1:\r\n subset = Subset(dimension_name='Month', subset_name='Q1', elements=['Jan', 'Feb', 'Mar'])\r\n tm1.subsets.create(subset, private=True)\r\n```\r\n\r\nFeatures\r\n=======================\r\n\r\nTM1py offers handy features to interact with TM1 from Python, such as\r\n\r\n- Functions to read data from cubes through cube views or MDX queries (e.g. `tm1.cells.execute_mdx`)\r\n- Functions to write data to cubes (e.g. `tm1.cells.write`)\r\n- Functions to update dimensions and hierarchies (e.g. `tm1.hierarchies.get`)\r\n- Functions to update metadata, clear or write to cubes directly from pandas dataframes (e.g. `tm1.elements.get_elements_dataframe`)\r\n- Async functions to easily parallelize your read or write operations (e.g. `tm1.cells.write_async`)\r\n- Functions to execute TI process or loose statements of TI (e.g. `tm1.processes.execute_with_return`)\r\n- CRUD features for all TM1 objects (cubes, dimensions, subsets, etc.)\r\n\r\nRequirements\r\n=======================\r\n\r\n- python (3.7 or higher)\r\n- requests\r\n- requests_negotiate_sspi\r\n- TM1 11, TM1 12\r\n- keyring\r\n\r\n\r\nOptional Requirements\r\n=======================\r\n\r\n- pandas\r\n\r\nInstall\r\n=======================\r\n\r\n> without pandas\r\n\r\n pip install tm1py\r\n \r\n> with pandas\r\n\r\n pip install \"tm1py[pandas]\"\r\n \r\n> keyring\r\n\r\n pip install keyring\r\n\r\nUsage\r\n=======================\r\n\r\n> TM1 11 on-premise\r\n\r\n``` python\r\nfrom TM1py.Services import TM1Service\r\n\r\nwith TM1Service(address='localhost', port=8001, user='admin', password='apple', ssl=True) as tm1:\r\n print(tm1.server.get_product_version())\r\n```\r\n\r\n> TM1 11 on IBM cloud\r\n\r\n``` python\r\nwith TM1Service(\r\n base_url='https://mycompany.planning-analytics.ibmcloud.com/tm1/api/tm1/',\r\n user=\"non_interactive_user\",\r\n namespace=\"LDAP\",\r\n password=\"U3lSn5QLwoQZY2\",\r\n ssl=True,\r\n verify=True,\r\n async_requests_mode=True) as tm1:\r\n print(tm1.server.get_product_version())\r\n```\r\n\r\n\r\n> TM1 12 MCSP\r\n\r\n``` python\r\nfrom TM1py import TM1Service\r\n\r\nparams = {\r\n \"base_url\": \"https://us-east-1.planninganalytics.saas.ibm.com/api/<TenantId>/v0/tm1/<DatabaseName>/\",\r\n \"user\": \"apikey\",\r\n \"password\": \"<TheActualApiKey>\",\r\n \"async_requests_mode\": True,\r\n \"ssl\": True,\r\n \"verify\": True\r\n}\r\n\r\nwith TM1Service(**params) as tm1:\r\n print(tm1.server.get_product_version())\r\n```\r\n\r\n\r\n> TM1 12 PAaaS\r\n\r\n``` python\r\nwith TM1Service(\r\n address=\"us-east-2.aws.planninganalytics.ibm.com\",\r\n api_key=\"AB4VfG7T8wPM-912uFKeYG5PGh0XbS80MVBAt7SEG6xn\",\r\n iam_url=\"https://iam.cloud.ibm.com/identity/token\",\r\n tenant=\"YA9A2T8BS2ZU\",\r\n database=\"Database\") as tm1:\r\n print(tm1.server.get_product_version())\r\n```\r\n\r\n\r\n> TM1 12 on-premise & Cloud Pak For Data\r\n\r\n``` python\r\nwith TM1Service(\r\n address=\"tm1-ibm-operands-services.apps.cluster.your-cluster.company.com\",\r\n instance=\"your instance name\",\r\n database=\"your database name\",\r\n application_client_id=\"client id\",\r\n application_client_secret=\"client secret\",\r\n user=\"admin\",\r\n ssl=True) as tm1:\r\n\r\n print(tm1.server.get_product_version())\r\n```\r\n\r\n\r\n\r\n\r\nDocumentation\r\n=======================\r\n\r\nhttps://tm1py.readthedocs.io/en/master/\r\n\r\n\r\nIssues\r\n=======================\r\n\r\nIf you find issues, sign up in Github and open an Issue in this repository\r\n\r\n\r\nContribution\r\n=======================\r\n\r\nTM1py is an open source project. It thrives on contribution from the TM1 community.\r\nIf 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.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A python module for TM1.",
"version": "2.0.4",
"project_urls": {
"Download": "https://github.com/Cubewise-code/TM1py/tarball/2.0.4",
"Homepage": "https://github.com/cubewise-code/tm1py"
},
"split_keywords": [
"tm1",
" ibm cognos tm1",
" planning analytics",
" pa",
" cognos"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "14e93069687a0a6bf7ff51f93b8b116b150c558d1b05e3a460f6efc1771fcca6",
"md5": "1e32cb4588bcc894c757a4851a3fb93d",
"sha256": "72a7730d9641274702e5bf942b882cfe08d1b9303169ceeb6b4eb19460f92594"
},
"downloads": -1,
"filename": "tm1py-2.0.4.tar.gz",
"has_sig": false,
"md5_digest": "1e32cb4588bcc894c757a4851a3fb93d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 146599,
"upload_time": "2024-06-28T09:38:47",
"upload_time_iso_8601": "2024-06-28T09:38:47.140892Z",
"url": "https://files.pythonhosted.org/packages/14/e9/3069687a0a6bf7ff51f93b8b116b150c558d1b05e3a460f6efc1771fcca6/tm1py-2.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-28 09:38:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cubewise-code",
"github_project": "tm1py",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tm1py"
}