Closed
Labels
enhancementneeds investigationIssue needs to be looked at by TableauIssue needs to be looked at by Tableaustale
Description
Description
Unless this functionality already exists, it would be helpful to directly use created Datasource/Workbook objects from the Document API as the source when publishing content via TSC. Currently, you have to pass a filepath or a file object, which I haven't found an example of. This would also reduce having to save files to the file system for quick on the fly datasource/workbook creation.
from tableaudocumentapi import Connection, Datasource
import tableauserverclient as tsc
ds = Datasource.from_connections(caption="", connections=[some_connection])
# do login magic, get information for publish
server.datasources.publish(
datasource_item=tsc.DatasourceItem(project_id, "My Cool Datasource"),
file=ds, # object? item?
mode=server.PublishMode.Overwrite,
connection_credentials=tsc.ConnectionCredentials(username, password),
)Metadata
Metadata
Assignees
Labels
enhancementneeds investigationIssue needs to be looked at by TableauIssue needs to be looked at by Tableaustale
Activity
nosnilmot commentedon Jan 13, 2023
This should already be possible:
Downloading from Tableau Server to such a file-like object by TSC is not yet supported (see #1172), but publishing should work.
github-actions commentedon Aug 18, 2026
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this is still relevant, please comment to keep it open.
jacalata commentedon Aug 25, 2026
Closing as completed. This is already possible today using the recipe nosnilmot posted in this thread: save your Document API
Datasource/Workbookobject to anio.BytesIO()viasave_as(), then pass that BytesIO as thefileargument toworkbooks.publish()/datasources.publish(). TSC's publish endpoints have accepted file-like objects for a while, so no new TSC surface is needed. If you hit a specific mismatch (e.g., a filetype detection edge case), please open a fresh issue with a reproducer.