You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-15Lines changed: 37 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,26 @@ This repo contains Python source and example files for the Tableau Document API.
6
6
7
7
Document API
8
8
---------------
9
-
The Document API provides a supported way to programmatically make updates to Tableau workbook (`.twb`) and datasource (`.tds`) 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 :)
10
-
11
-
Currently only the following operations are supported:
12
-
13
-
- Modify database server
14
-
- Modify database name
15
-
- Modify database user
16
-
17
-
We don't yet support creating files from scratch. In addition, support for `.twbx` and `.tdsx` files is coming.
9
+
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 :)
10
+
11
+
Features include:
12
+
- Support for 9.X, and 10.X workbook and data source files
13
+
- Including TDSX and TWBX files
14
+
- Getting connection information from data sources and workbooks
15
+
- Server Name
16
+
- Username
17
+
- Database Name
18
+
- Authentication Type
19
+
- Connection Type
20
+
- Updating connection information in workbooks and data sources
21
+
- Server Name
22
+
- Username
23
+
- Database Name
24
+
- Getting Field information from data sources and workbooks
25
+
- Get all fields in a data source
26
+
- Get all feilds in use by certain sheets in a workbook
27
+
28
+
We don't yet support creating files from scratch, adding extracts into workbooks or data sources, or updating field information
18
29
19
30
20
31
###Getting Started
@@ -34,8 +45,19 @@ Download the `.zip` file that contains the SDK. Unzip the file and then run the
34
45
pip install -e <directory containing setup.py>
35
46
```
36
47
37
-
We plan on putting the package in PyPi to make installation easier.
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*
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:
38
57
58
+
```text
59
+
pip uninstall tableaudocumentapi
60
+
```
39
61
40
62
###Basics
41
63
The following example shows the basic syntax for using the Document API to update a workbook:
With Data Integration in Tableau 10, a datasource can have multiple connections. To access the connections simply index them like you would datasources
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
56
78
57
79
```python
58
80
from tableaudocumentapi import Workbook
@@ -75,13 +97,13 @@ sourceWB.save()
75
97
**Notes**
76
98
77
99
- Import the `Workbook` object from the `tableaudocumentapi` module.
78
-
- To open a workbook, instantiate a `Workbook` object and pass the `.twb`file name in the constructor.
79
-
- The `Workbook` object exposes a `datasources`collection.
80
-
- Each datasource object has a `connection` object that supports a `server`, `dbname`, and `username` property.
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.
81
103
- Save changes to the workbook by calling the `save` or `save_as` method.
82
104
83
105
84
106
85
107
###Examples
86
108
87
-
The downloadable package contains an example named `replicateWorkbook.py` (in the folder `\Examples\Replicate Workbook`). This example reads an existing workbook and reads a .csv file that contains a list of servers, database names, and users. For each new user in the .csv file, the code copies the original workbook, updates the `server`, `dbname`, and `username` properties, and saves the workbook under a new name.
109
+
The downloadable package contains several example scripts that show more detailed usage of the Document API
Contribution can include, but are not limited to, any of the following:
6
+
7
+
* File an Issue
8
+
* Request a Feature
9
+
* Implement a Requested Feature
10
+
* Fix an Issue/Bug
11
+
* Add/Fix documentation
12
+
13
+
Contributions must follow the guidelines outlined on the [Tableau Organization](http://tableau.github.io/) page, though filing an issue or requesting
14
+
a feature do not require the CLA.
15
+
16
+
## Issues and Feature Requests
17
+
18
+
To submit an issue/bug report, or to request a feature, please submit a [github issue](https://github.com/tableau/document-api-python/issues) to the repo.
19
+
20
+
If you are submiting a bug report, please provide as much information as you can, including clear and concise repro steps, attaching any necessary
21
+
files to assist in the repro. **Be sure to scrub the files of any potentially sensitive information. Issues are public.**
22
+
23
+
For a feature request, please try to describe the scenario you are trying to accomplish that requires the feature. This will help us understand
24
+
the limitations that you are running into, and provide us with a use case to know if we've satisfied your request.
25
+
26
+
## Fixes, Implementations, and Documentation
27
+
28
+
For all other things, please submit a PR that includes the fix, documentation, or new code that you are trying to contribute. More information on
29
+
creating a PR can be found in the [github documentation](https://help.github.com/articles/creating-a-pull-request/)
30
+
31
+
If the feature is complex or has multiple solutions that could be equally appropriate approaches, it would be helpful to file an issue to discuss the
32
+
design trade-offs of each solution before implementing, to allow us to collectively arrive at the best solution, which most likely exists in the middle
0 commit comments