10000 sample info (#10) · bonomali/server-client-python@444c2ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 444c2ea

Browse files
authored
sample info (tableau#10)
* sample info Adding information about the samples to readme. minor typo fix in set_http_options.py * added more details to README * adding note about 403033 error
1 parent 8e1040b commit 444c2ea

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed

README.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,59 @@
11
# server-api-python
2-
This repo contains Python source and sample files for the Tableau Server API.
2+
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.
33

4-
This repository is currently NOT ready to be made public. Please leave this
5-
as a private repo for now.
4+
This repository contains Python source and sample files.
65

7-
Server API
8-
---------------
96
###Getting Started
10-
To use this SDK, you must have Python installed. You can use either 2.7.X or 3.3 and later.
7+
You must have Python installed. You can use either 2.7.X or 3.3 and later.
8+
9+
#### Installing the latest stable version (preferred)
10+
11+
```text
12+
pip install tableauserverapi
13+
```
14+
15+
#### Installing From Source
16+
17+
Download the `.zip` file. Unzip the file and then run the following command:
18+
19+
```text
20+
pip install -e <directory containing setup.py>
21+
```
22+
23+
#### Installing the Development Version from Git
24+
25+
*Only do this if you know you want the development version, no guarantee that we won't break APIs during development*
26+
27+
```text
28+
pip install git+https://github.com/tableau/server-api-python.git@development
29+
```
30+
31+
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:
32+
33+
```text
34+
pip uninstall tableauserverapi
35+
```
36+
37+
###Basics
38+
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:
39+
40+
```python
41+
import tableauserverapi
42+
43+
tableau_auth = tableauserverapi.TableauAuth('USERNAME', 'PASSWORD')
44+
server = tableauserverapi.Server('SERVER')
45+
46+
with server.auth.sign_in(tableau_auth):
47+
pagination_info, all_workbooks = server.workbooks.get()
48+
```
49+
50+
###Server API Samples
51+
* Can be run using the command prompt or terminal
52+
53+
Demo | Source Code | Description
54+
-------- | -------- | --------
55+
Publish Workbook | [publish_workbook.py](./samples/publish_workbook.py) | Shows how to upload a Tableau workbook.
56+
Move Workbook | [move_workbook_projects.py](./samples/move_workbook_projects.py)<br />[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.<br /><br />Moving to another project uses an API call to update workbook.<br />Moving to another site uses in-memory download method.
57+
Set HTTP Options | [set_http_options.py](./samples/set_http_options.py) | Sets HTTP options on server and downloads workbooks.
58+
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.
59+
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.

samples/set_http_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This script demonstrates how to set http options. It will set the option
33
# to not verify SSL certificate, and query all workbooks on site.
44
#
5-
# For more information, refer to the documentations on 'Publish Workbook'
5+
# For more information, refer to the documentation on 'Publish Workbook'
66
# (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm)
77
#
88
# To run the script, you must have installed Python 2.7.9 or later.

0 commit comments

Comments
 (0)
0