8000 Merge pull request #174 from tableau/development · SnarkyPapi/server-client-python@513e5e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 513e5e9

Browse files
author
Russell Hay
authored
Merge pull request tableau#174 from tableau/development
Release 0.4 to master
2 parents 8e6c907 + 470d2ef commit 513e5e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3573
-115
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tableauserverclient/_version.py export-subst

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 0.4 (18 April 2017)
2+
3+
Yikes, it's been too long.
4+
5+
* Added API version annotations to endpoints (#125)
6+
* Added New High Res Image Api Endpoint
7+
* Added Tags to Datasources, Views
8+
* Added Ability to run an Extract Refresh task (#159)
9+
* Auto versioning enabled (#169)
10+
* Download twbx/tdsx without the extract payload (#143, #144)
11+
* New Sample to initialize a server (#95)
12+
* Added ability to update connection information (#149)
13+
* Added Ability to get a site by name (#153)
14+
* Dates are now DateTime Objects (#102)
15+
* Bugfixes (#162, #166)
16+
117
## 0.3 (11 January 2017)
218

319
* Return DateTime objects instead of strings (#102)

CONTRIBUTORS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ The following people have contributed to this project to make it possible, and w
77
* [geordielad](https://github.com/geordielad)
88
* [Hugo Stijns)(https://github.com/hugoboos)
99
* [kovner](https://github.com/kovner)
10+
* [Talvalin](https://github.com/Talvalin)
11+
* [Chris Toomey](https://github.com/cmtoomey)
12+
* [Vathsala Achar](https://github.com/VathsalaAchar)
13+
* [Graeme Britz](https://github.com/grbritz)
1014

1115

1216
## Core Team
@@ -17,3 +21,5 @@ The following people have contributed to this project to make it possible, and w
1721
* [RussTheAerialist](https://github.com/RussTheAerialist)
1822
* [Ben Lower](https://github.com/benlower)
1923
* [Jared Dominguez](https://github.com/jdomingu)
24+
* [Jackson Huang](https://github.com/jz-huang)
25+
* [Brendan Lee](https://github.com/lbrendanl)

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include versioneer.py
2+
include tableauserverclient/_version.py

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ This repository contains Python source code and sample files.
1010

1111
For more information on installing and using TSC, see the documentation:
1212

13-
<https://tableau.github.io/server-client-python/docs/>
14-
13+
<https://tableau.github.io/server-client-python/docs/>

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ anyone can add to an issue:
4848
## Fixes, Implementations, and Documentation
4949

5050
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
51-
creating a PR can be found in the [github documentation](https://help.github.com/articles/creating-a-pull-request/)
51+
creating a PR can be found in the [Development Guide](docs/docs/dev-guide.md)
5252

5353
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
5454
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

docs/_includes/docs_menu.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div class="well docs-menu col-xs-12 col-sm-4 col-md-3">
2+
{% include search_form.html %}
23
<ul class="nav nav-list">
34
<li>
45
<a href="{{ site.baseurl }}/docs">Get Started</a>

docs/_includes/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
1212
<link rel="stylesheet" href="{{ site.baseurl }}/css/github-highlight.css">
1313

14+
<script src="{{ site.baseurl }}/js/redirect-to-search.js"></script>
1415
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
1516
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
1617

docs/_includes/search_form.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div class="search-container form-group has-feedback">
2+
<form id="docs-search">
3+
<input type="search" id="search-input" class="custom-search form-control" placeholder="Search the docs..." search-url="{{ site.baseurl}}/docs/search.html">
4+
<span class="glyphicon glyphicon-search form-control-feedback"></span>
5+
</form>
6+
</div>
7+

docs/_layouts/search.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
layout: search
3+
---
4+
5+
<!DOCTYPE html>
6+
<html>
7+
8+
<head>
9+
{% include head.html %}
10+
<script type="text/javascript">
11+
var search_blob = {
12+
{% for page in site.pages %}
13+
{% if page.indexed_by_search != false %}
14+
"{{ site.baseurl }}{{ page.url }}": {
15+
"title": {{ page.title | escape | jsonify }},
16+
"content": {{ page.content | remove_first: '* TOC' | replace_first:':toc',':class="blank"' | markdownify | strip_html | normalize_whitespace | jsonify }}
17+
}{% unless forloop.last %},{% endunless %}
18+
{% endif %}
19+
{% endfor %}
20+
};
21+
</script>
22+
23+
<script src="{{ site.baseurl }}/js/lunr.min.js"></script>
24+
<script src="{{ site.baseurl }}/js/search.js"></script>
25+
</head>
26+
27+
<body>
28+
<div class="container">
29+
{% include header.html %}
30+
{% include docs_menu.html %}
31+
32+
<div class="content .col-xs-12 .col-sm-8 .col-md-9">
33+
<h1 id="searchHeading"></h1>
34+
<br />
35+
<div id="searchResultsContainer">
36+
<p>Loading search results...</p>
37+
</div>
38+
39+
{% include footer.html %}
40+
</div>
41+
</div>
42+
</body>
43+
</html>

docs/docs/api-ref.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ Modifies a workbook. The workbook item object must include the workbook ID and o
180180
Workbooks.update(wb_item_object)
181181
```
182182

183+
### Update workbook connection
184+
185+
Updates a workbook connection string. The workbook connections must be populated before they strings can be updated.
186+
187+
```py
188+
Workbooks.update_conn(workbook, workbook.connections[0])
189+
```
190+
183191
### Delete Workbook
184192

185193
Deletes a workbook with the given ID.

docs/docs/dev-guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ This topic describes how to contribute to the Tableau Server Client (Python) pro
2222
git clone git@github.com:<user-name>/server-client-python.git
2323
```
2424

25+
1. Switch to the development branch
26+
27+
```shell
28+
git checkout development
29+
```
30+
2531
1. Run the tests to make sure everything is peachy:
2632

2733
```shell

docs/docs/populate-connections-views.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ server.workbooks.populate_connections(workbook)
3434
print([connection.datasource_name for connection in workbook.connections])
3535
```
3636

37+
## Update connections for workbooks
38+
39+
```py
40+
server.workbooks.populate_connections(workbook)
41+
conn_to_update = workbook.connections[0]
42+
conn_to_update.server_address = 'new_address'
43+
conn_to_update.server_port = 1234
44+
conn_to_update.username = 'username'
45+
conn_to_update.password = 'password'
46+
conn_to_update.embed_password = True/False
47+
server.workbooks.update_conn(workbook, conn_to_update)
48+
```
49+
3750
## Populate connections for data sources
3851

3952
```py

docs/docs/samples.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The following list describes the samples available in the repository:
4040

4141
* `explore_workbook.py`. Queries workbooks, selects a workbook, populates the connections and views for a workbook, then updates the workbook.
4242

43+
* `download_view_image.py`. Queries for view based on name specified in filter, populates the image and saves the image to specified file path.
44+
4345
* `move_workbook_projects.py`. Updates the properties of a workbook to move the workbook from one project to another.
4446

4547
* `move_workbook_sites.py`. Downloads a workbook, stores it in-memory, and uploads it to another site.

docs/docs/search.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Search
3+
layout: search
4+
---
5+

docs/docs/sign-in-out.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Sign In and Out
33
layout: docs
44
---
5-
5+
## Signing in and out
66
To sign in and out of Tableau Server, call the `Auth.sign_in` and `Auth.sign_out` functions like so:
77

88
```py
@@ -18,22 +18,53 @@ server.auth.sign_in(tableau_auth)
1818
server.auth.sign_out()
1919
```
2020

21+
Alternatively, for short programs, consider using a `with` block:
22+
23+
```py
24+
import tableauserverclient as TSC
25+
26+
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
27+
server = TSC.Server('http://SERVER_URL')
28+
29+
with server.auth.sign_in(tableau_auth):
30+
# Do awesome things here!
31+
32+
# No need to call auth.sign_out() as the Auth context manager will handle that on exiting the with block
33+
```
34+
2135
<div class="alert alert-info">
2236
<b>Note:</b> When you sign in, the TSC library manages the authenticated session for you, however it is still
2337
limited by the maximum session length (of four hours) on Tableau Server.
2438
</div>
2539

26-
27-
Alternatively, for short programs, consider using a `with` block:
40+
### Disabling certificate verification and warnings
41+
Certain environments may throw errors related to SSL configuration, such as self-signed certificates or expired certificates. These errors can be avoided by disabling certificate verification with ```add_http_options```:
2842

2943
```py
3044
import tableauserverclient as TSC
3145

3246
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
3347
server = TSC.Server('http://SERVER_URL')
48+
server.add_http_options({'verify': False})
49+
```
3450

35-
with server.auth.sign_in(tableau_auth):
36-
# Do awesome things here!
51+
However, each subsequent REST API call will print an ```InsecureRequestWarning```:
52+
```
53+
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
54+
InsecureRequestWarning)
55+
```
56+
57+
These warnings can be disabled by adding the following lines to your script:
58+
```py
59+
import requests
60+
from requests.packages.urllib3.exceptions import InsecureRequestWarning
61+
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
3762
```
3863

39-
The TSC library signs you out of Tableau Server when you exit out of the `with` block.
64+
### A better way to avoid certificate warnings
65+
Instead of disabling warnings and certificate verification to workaround issues with untrusted certificates, the best practice is to use a certificate signed by a Certificate Authority.
66+
67+
If you have the ability to do so, we recommend the following Certificate Authorities:
68+
* [GlobalSign](https://www.globalsign.com/en/)
69+
* [Let's Encrypt](https://letsencrypt.org/) - a free, automated, and open Certificate Authority
70+
* [SSL.com](https://www.ssl.com/)

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: home
3+
indexed_by_search: false
34
---
45

56
<header class="jumbotron hero-spacer text-center">

0 commit comments

Comments
 (0)
0