My code :
My code:
⌗sign in
tableau_auth = TSC.TableauAuth(user, password)
server = TSC.Server(r'http://yourserver.com')
server.use_server_version()
with server.auth.sign_in(tableau_auth):
⌗csv file create with view_item.csv
all_workbooks, pagination_item = server.workbooks.get()
wfound = [workbook for workbook in all_workbooks if workbook.name == 'MyWorkbook']
wconnect = server.workbooks.get_by_id(wfound[0].id)
server.workbooks.populate_views(wconnect)
vfound = [view for view in wconnect.views if len(view.name) > 0]
view_item = vfound[0]
server.views.populate_csv(view_item)
with open('view_csv.csv','wb') as f:
f.write(b''.join(view_item.csv))
⌗subscrptions
target = TSC.Target('', 'workbook')
schedule_id = ''
user_id = ''
new_sub = TSC.SubscriptionItem('My Subscription', schedule_id, user_id, target)
⌗new_sub.attach_image = False
⌗new_sub.attach_pdf = True
new_sub.message = "You have an alert!"
⌗new_sub.page_orientation = TSC.PDFRequestOptions.Orientation.Landscape
⌗new_sub.page_size_option = TSC.PDFRequestOptions.PageType.B4
new_sub.send_if_view_empty = True
new_sub = server.subscriptions.create(new_sub)
print(new_sub.subject)
⌗CSv file was downloded into curent Dir.
When i subscribe is there any possible to send mail with the csv file