From 32f453bdd33e7ebf962ccb07dc704b95c45de1b6 Mon Sep 17 00:00:00 2001 From: Ben Lower Date: Sat, 3 Sep 2016 13:36:01 -0700 Subject: [PATCH 1/3] sample info Adding information about the samples to readme. minor typo fix in set_http_options.py --- README.md | 38 +++++++++++++++++++++++++++++++------ samples/set_http_options.py | 2 +- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8d79066ae..15f9ada04 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,36 @@ # server-api-python -This repo contains Python source and sample files for the Tableau Server API. +Tableau Server API is a client library for the Tableau REST API. The Server API is delightful to use and easy to love because it requires writing much less code than working directly with the REST API. + +This repository contains Python source and sample files. + +This repository is currently NOT ready to be made public. Please leave this as a private repo for now. -This repository is currently NOT ready to be made public. Please leave this -as a private repo for now. -Server API ---------------- ###Getting Started -To use this SDK, you must have Python installed. You can use either 2.7.X or 3.3 and later. +You must have Python installed. You can use either 2.7.X or 3.3 and later. + +#### Installing the latest stable version (preferred) + +```text +pip install tableauserverapi +``` + +#### Installing From Source + +Download the `.zip` file. Unzip the file and then run the following command: + +```text +pip install -e +``` + + +###Server API Samples +* Can be run using the command prompt or terminal + +Demo | Source Code | Description +-------- | -------- | -------- +Publish Workbook | [publish_workbook.py](./samples/publish_workbook.py) | Shows how to upload a Tableau workbook. +Move Workbook | [move_workbook_projects.py](./samples/move_workbook_projects.py)
[move_workbook_sites.py](./samples/move_workbook_sites.py) | Shows how to move a workbook from one project/site to another. Moving across different sites require downloading the workbook. 2 methods of downloading are demonstrated in the sites sample.

Moving to another project uses an API call to update workbook.
Moving to another site uses in-memory download method. +Set HTTP Options | [set_http_options.py](./samples/set_http_options.py) | Sets HTTP options on server and downloads workbooks. +Explore Datasource | [explore_datasource.py](./samples/explore_datasource.py) | Demonstrates working with Tableau Datasource. Queries all datasources, picks one and populates its connections, then updates the datasource. Has additional flags for publish and download. +Explore Workbook | [explore_workbook.py](./samples/explore_workbook.py) | Demonstrates working with Tableau Workbook. Queries all workbooks, picks one and populates its connections/views, then updates the workbook. Has additional flags for publish, download, and getting the preview image. \ No newline at end of file diff --git a/samples/set_http_options.py b/samples/set_http_options.py index 487be46f0..39711a7fc 100644 --- a/samples/set_http_options.py +++ b/samples/set_http_options.py @@ -2,7 +2,7 @@ # This script demonstrates how to set http options. It will set the option # to not verify SSL certificate, and query all workbooks on site. # -# For more information, refer to the documentations on 'Publish Workbook' +# For more information, refer to the documentation on 'Publish Workbook' # (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm) # # To run the script, you must have installed Python 2.7.9 or later. From bb058128cbf97b85f49e13720d44a43f8c9e1234 Mon Sep 17 00:00:00 2001 From: shinchris Date: Tue, 6 Sep 2016 16:36:48 -0700 Subject: [PATCH 2/3] added more details to README --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 15f9ada04..812afdb6f 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,32 @@ Download the `.zip` file. Unzip the file and then run the following command: pip install -e ``` +#### Installing the Development Version from Git + +*Only do this if you know you want the development version, no guarantee that we won't break APIs during development* + +```text +pip install git+https://github.com/tableau/server-api-python.git@development +``` + +If you go this route, but want to switch back to the non-development version, you need to run the following command before installing the stable version: + +```text +pip uninstall tableauserverapi +``` + +###Basics +The following example shows the basic syntax for using the Server API to query a list of all workbooks and the associated pagination information on the default site: + +```python +import tableauserverapi + +tableau_auth = tableauserverapi.TableauAuth('USERNAME', 'PASSWORD') +server = tableauserverapi.Server('SERVER') + +with server.auth.sign_in(tableau_auth): + pagination_info, all_workbooks = server.workbooks.get() +``` ###Server API Samples * Can be run using the command prompt or terminal From 481fc94c66e036ba0e56e907647f8595d910b638 Mon Sep 17 00:00:00 2001 From: Ben Lower Date: Thu, 8 Sep 2016 09:39:58 -0700 Subject: [PATCH 3/3] adding note about 403033 error --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 812afdb6f..48764982e 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,6 @@ Tableau Server API is a client library for the Tableau REST API. The Server API This repository contains Python source and sample files. -This repository is currently NOT ready to be made public. Please leave this as a private repo for now. - - ###Getting Started You must have Python installed. You can use either 2.7.X or 3.3 and later. @@ -59,4 +56,4 @@ Publish Workbook | [publish_workbook.py](./samples/publish_workbook.py) | Shows Move Workbook | [move_workbook_projects.py](./samples/move_workbook_projects.py)
[move_workbook_sites.py](./samples/move_workbook_sites.py) | Shows how to move a workbook from one project/site to another. Moving across different sites require downloading the workbook. 2 methods of downloading are demonstrated in the sites sample.

Moving to another project uses an API call to update workbook.
Moving to another site uses in-memory download method. Set HTTP Options | [set_http_options.py](./samples/set_http_options.py) | Sets HTTP options on server and downloads workbooks. Explore Datasource | [explore_datasource.py](./samples/explore_datasource.py) | Demonstrates working with Tableau Datasource. Queries all datasources, picks one and populates its connections, then updates the datasource. Has additional flags for publish and download. -Explore Workbook | [explore_workbook.py](./samples/explore_workbook.py) | Demonstrates working with Tableau Workbook. Queries all workbooks, picks one and populates its connections/views, then updates the workbook. Has additional flags for publish, download, and getting the preview image. \ No newline at end of file +Explore Workbook | [explore_workbook.py](./samples/explore_workbook.py) | Demonstrates working with Tableau Workbook. Queries all workbooks, picks one and populates its connections/views, then updates the workbook. Has additional flags for publish, download, and getting the preview image. Note: if you don't have permissions on the workbook the script retrieves from the server, the script will result in a 403033 error. This is expected. \ No newline at end of file