document-api-python icon indicating copy to clipboard operation
document-api-python copied to clipboard

Creating workbooks and data source files

Open henridwyer opened this issue 9 years ago • 5 comments

It would be very useful to be able to create a workbook or data source files, not only modify existing ones.

henridwyer avatar Jul 28 '16 19:07 henridwyer

Thanks, @henridwyer! Creation is definitely on our radar. Do you have any suggested starting points? How would you want to create something? Totally from scratch? Would love any more info you could provide about how you'd like to use it.

benlower avatar Jul 28 '16 21:07 benlower

It would be nice to create a TDS for any arbitrary connection, something like:

connection = Connection.create(dbname, server, username, authentication)
Datasource.create(output_file_name, connections=[connection]).save()

henridwyer avatar Jul 28 '16 21:07 henridwyer

OK cool thanks for the additional feedback.

From: Henri Dwyer [email protected] Reply-To: tableau/document-api-python [email protected] Date: Thursday, July 28, 2016 at 14:41 To: tableau/document-api-python [email protected] Cc: Ben Lower [email protected], Comment [email protected] Subject: Re: [tableau/document-api-python] Creating workbooks and data source files (#68)

It would be nice to create a TDS for any arbitrary connection, something like:

connection = Connection.create(dbname, server, username, authentication) Datasource.create(output_file_name, connections=[connection]).save() — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

benlower avatar Jul 28 '16 21:07 benlower

Creating a connection (with the subset of elements we support today) would be pretty simple: Add a new class method that builds an empty Connection ElementTree-tree and then pass that into the existing Constructor and fill out all the attributes.

Making a datasource is a little trickier... Making the skeleton for the XML is easy enough, but we don't have any logic to build out columns and such yet -- I think an empty datasource would still load in Desktop/Server but I'd have to check to see if anything is broken.

I like the api recommended by @henridwyer -- connections=[c1, c2, c3]

t8y8 avatar Jul 30 '16 06:07 t8y8

Any update on this I am also trying to create empty Workbooks with DataSource in it.

rishabh-90 avatar Sep 27 '17 18:09 rishabh-90