Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from MariusWirtz/master
session_context sample
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" | ||
Instantiate TM1py with a custom session_context. | ||
Session_context is displayed in column "session" in Arc | ||
""" | ||
|
||
import configparser | ||
|
||
from TM1py.Services import TM1Service | ||
|
||
config = configparser.ConfigParser() | ||
config.read('..\config.ini') | ||
|
||
APP_NAME = "My TM1py Application" | ||
|
||
with TM1Service(**config['tm1srv01'], session_context=APP_NAME) as tm1: | ||
dimensions = tm1.dimensions.get_all_names() | ||
for dim in dimensions: | ||
print(dim) |