8000 Add docs link to Readme · GapData/document-api-python@e7b7830 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e7b7830

Browse files
committed
Add docs link to Readme
1 parent b852530 commit e7b7830

File tree

1 file changed

+4
-81
lines changed

1 file changed

+4
-81
lines changed

README.md

Lines changed: 4 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
This repo contains Python source and example files for the Tableau Document API. We're just getting started and have plans to expand what you find here. Help us by submitting feedback, issues, and pull requests!
66

7+
For more information, see the documentation:
8+
9+
<tableau.github.io/document-api-python>
10+
711
Document API
812
---------------
913
The Document API provides a supported way to programmatically make updates to Tableau workbook and data source files. If you've been making changes to these file types by directly updating the XML--that is, by XML hacking--this SDK is for you :)
@@ -26,84 +30,3 @@ Features include:
2630
- Get all fields in use by certain sheets in a workbook
2731

2832
We don't yet support creating files from scratch, adding extracts into workbooks or data sources, or updating field information
29-
30-
31-
###Getting Started
32-
To use this SDK, you must have Python installed. You can use either 2.7.X or 3.3 and later.
33-
34-
#### Installing the latest stable version (preferred)
35-
36-
```text
37-
pip install tableaudocumentapi
38-
```
39-
40-
#### Installing From Source
41-
42-
Download the `.zip` file that contains the SDK. Unzip the file and then run the following command:
43-
44-
```text
45-
pip install -e <directory containing setup.py>
46-
```
47-
48-
#### Installing the Development Version from Git
49-
50-
*Only do this if you know you want the development version, no guarantee that we won't break APIs during development*
51-
52-
```text
53-
pip install git+https://github.com/tableau/document-api-python.git@development
54-
```
55-
56-
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:
57-
58-
```text
59-
pip uninstall tableaudocumentapi
60-
```
61-
62-
###Basics
63-
The following example shows the basic syntax for using the Document API to update a workbook:
64-
65-
```python
66-
from tableaudocumentapi import Workbook
67-
68-
sourceWB = Workbook('WorkbookToUpdate.twb')
69-
70-
sourceWB.datasources[0].connections[0].server = "MY-NEW-SERVER"
71-
sourceWB.datasources[0].connections[0].dbname = "NEW-DATABASE"
72-
sourceWB.datasources[0].connections[0].username = "benl"
73-
74-
sourceWB.save()
75-
```
76-
77-
With Data Integration in Tableau 10, a data source can have multiple connections. To access the connections simply index them like you would datasources.
78-
79-
```python
80-
from tableaudocumentapi import Workbook
81-
82-
sourceWB = Workbook('WorkbookToUpdate.twb')
83-
84-
sourceWB.datasources[0].connections[0].server = "MY-NEW-SERVER"
85-
sourceWB.datasources[0].connections[0].dbname = "NEW-DATABASE"
86-
sourceWB.datasources[0].connections[0].username = "benl"
87-
88-
sourceWB.datasources[0].connections[1].server = "MY-NEW-SERVER"
89-
sourceWB.datasources[0].connections[1].dbname = "NEW-DATABASE"
90-
sourceWB.datasources[0].connections[1].username = "benl"
91-
92-
93-
sourceWB.save()
94-
```
95-
96-
97-
**Notes**
98-
99-
- Import the `Workbook` object from the `tableaudocumentapi` module.
100-
- To open a workbook, instantiate a `Workbook` object and pass the file name as the first argument.
101-
- The `Workbook` object exposes a list of `datasources` in the workbook
102-
- Each data source object has a `connection` object that supports a `server`, `dbname`, and `username` property.
103-
- Save changes to the workbook by calling the `save` or `save_as` method.
104-
105-
106-
107-
###[Examples](samples)
108-
109-
The downloadable package contains several example scripts that show more detailed usage of the Document API.

0 commit comments

Comments
 (0)
0