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
from datetime import datetime | |
from TM1py.Exceptions import TM1pyTimeout | |
from TM1py.Services.TM1Service import TM1Service | |
sdata_params = { | |
"address": "", | |
"port": 8010, | |
"ssl": True, | |
"user": "Admin", |
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
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1: | |
cell_annotation = Annotation( | |
comment_value="Manually updated by Marius", | |
object_name="Sales", | |
dimensional_context=["202201", "Act", "On-trade", "C0051", "Belgian-Style Ale", "DE", "Quantity"]) | |
tm1.annotations.create(cell_annotation) | |
existing_annotations = tm1.annotations.get_all(cube_name="Sales") | |
print(existing_annotations) |
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
from TM1py import TM1Service | |
from constants import prod_params | |
CUBE_NAME = "Sales" | |
VIEW_NAME = "Marius" | |
with TM1Service(**prod_params) as tm1: | |
df = tm1.cells.execute_view_dataframe( | |
cube_name=CUBE_NAME, |
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
from TM1py import TM1Service | |
from constants import prod_params | |
LOCAL_FILE_NAME = "sales.csv" | |
TARGET_FILE_NAME = "sales.csv" | |
with TM1Service(**prod_params) as tm1: | |
with open(LOCAL_FILE_NAME, "rb") as file: | |
tm1.files.update_or_create(TARGET_FILE_NAME, file_content=file.read()) |
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
from TM1py import TM1Service | |
from TM1py.Objects.Dimension import Dimension | |
from TM1py.Objects.Hierarchy import Hierarchy | |
params = { | |
"address": "", | |
"port": 8010, | |
"user": "admin", | |
"password": "apple", | |
"ssl": True |
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
from datetime import datetime | |
from TM1py.Objects.Axis import ViewAxisSelection | |
from TM1py.Objects.Cube import Cube | |
from TM1py.Objects.Dimension import Dimension | |
from TM1py.Objects.Hierarchy import Hierarchy | |
from TM1py.Objects.NativeView import NativeView | |
from TM1py.Objects.Subset import AnonymousSubset | |
from TM1py.Services.TM1Service import TM1Service |
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
from datetime import datetime | |
from datetime import timedelta | |
from TM1py.Objects.Cube import Cube | |
from TM1py.Objects.Dimension import Dimension | |
from TM1py.Objects.Hierarchy import Hierarchy | |
from TM1py.Services.TM1Service import TM1Service | |
tm1_params = { | |
"address": "", |
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
from datetime import datetime | |
import pandas as pd | |
from TM1py import TM1Service | |
with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1: | |
df = tm1.cells.execute_view_dataframe( | |
cube_name="Sales", | |
view_name="2020 Revenue by BU and Product", | |
dtype={"Value": float}) |
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
from TM1py import TM1Service | |
with TM1Service(base_url="https://localhost:12354", user="admin", password="") as tm1: | |
df = tm1.cells.execute_view_dataframe( | |
cube_name="Sales", | |
view_name="2020 Revenue by BU and Product") |
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
from io import StringIO | |
import pandas | |
from TM1py import TM1Service | |
csv_string = """ | |
Customer,Employee,Date,City,Country,Measure,Value | |
DUMO,1,1996-09-20,Nantes,France,Quantity,24.69 | |
ALFKI,1,2022-08-02,Bern,Switzerland,Quantity,34 |
NewerOlder