4

I have to upload a lot of worksheets to tableau server. Many of those will be created and uploaded temporarily. I want to delete some workbook uploaded to tableau server since those are no more in use. How can I do that in python programmatically?

code.dev.world
  • 221
  • 2
  • 12

2 Answers2

4

Please use TSC(Tableau Server Client).

https://github.com/tableau/server-client-python/blob/master/docs/docs/api-ref.md

You can get detailed info there. You can delete the workbook by it's id.

workbooks.delete(workbook_id)
Anton.Y
  • 136
  • 1
  • 5
2

You can also do it using standard libraries and tabcmd.

import subprocess
subprocess.call(['tabcmd','login','-s','<server>','-u','<username>','-p','<password>'])
subprocess.call(['tabcmd','delete','<workbookname>'])

See documentation for subprocess for more options, including how to get info on failures and output.

S. User18
  • 712
  • 3
  • 8
  • Hi, how would look like a syntax if I would like to download a file as --fullpdf from Tableau server? – BC1554 May 15 '20 at 09:30