Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial documentation for TSC #98

Merged
merged 10 commits into from
Nov 3, 2016
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,8 @@ $RECYCLE.BIN/
*.msp

# Windows shortcuts
*.lnk
*.lnk

# Documentation
docs/_site/
docs/.jekyll-metadata
62 changes: 8 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,13 @@
# server-client-python
Tableau Server Client is a client library for the Tableau REST API. The Server Client is delightful to use and easy to love because it requires writing much less code than working directly with the REST API.
# Tableau Server Client (Python)

This repository contains Python source and sample files.
Use the Tableau Server Client (TSC) library to increase your productivity as you interact with the Tableau Server REST API. With the TSC library you can do almost everything that you can do with the REST API, including:

###Getting Started
You must have Python installed. You can use either 2.7.X or 3.3 and later.
* Publish workbooks and data sources.
* Create users and groups.
* Query projects, sites, and more.

#### Installing the latest stable version (preferred)
This repository contains Python source code and sample files.

```text
pip install tableauserverclient
```
For more information on installing and using TSC, see the documentation:

#### Installing From Source

Download the `.zip` file. Unzip the file and then run the following command:

```text
pip install -e <directory containing setup.py>
```

#### 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-client-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 tableauserverclient
```

###Basics
The following example shows the basic syntax for using the Server Client to query a list of all workbooks and the associated pagination information on the default site:

```python
import tableauserverclient

tableau_auth = tableauserverclient.TableauAuth('USERNAME', 'PASSWORD')
server = tableauserverclient.Server('SERVER')

with server.auth.sign_in(tableau_auth):
all_workbooks, pagination_item = server.workbooks.get()
```

###Server Client 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)<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.
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. 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.
<https://tableau.github.io/server-client-python/docs/>
3 changes: 3 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins

129 changes: 129 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
colorator (0.1)
ethon (0.9.0)
ffi (>= 1.3.0)
execjs (2.7.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
ffi (1.9.10-x86-mingw32)
gemoji (2.1.0)
github-pages (80)
github-pages-health-check (= 1.1.0)
jekyll (= 3.1.6)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.5.1)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 1.11.1)
jekyll-mentions (= 1.1.2)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.10.0)
jekyll-sass-converter (= 1.3.0)
jekyll-seo-tag (= 1.4.0)
jekyll-sitemap (= 0.10.0)
jemoji (= 0.6.2)
kramdown (= 1.10.0)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
rouge (= 1.10.1)
terminal-table (~> 1.4)
github-pages-health-check (1.1.0)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 1.4)
typhoeus (~> 0.7)
html-pipeline (2.4.1)
activesupport (>= 2, < 5)
nokogiri (>= 1.4)
i18n (0.7.0)
jekyll (3.1.6)
colorator (~> 0.1)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.5.1)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (1.11.1)
octokit (~> 4.0)
jekyll-mentions (1.1.2)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.10.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-seo-tag (1.4.0)
jekyll (~> 3.0)
jekyll-sitemap (0.10.0)
jekyll-watch (1.4.0)
listen (~> 3.0, < 3.1)
jemoji (0.6.2)
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
json (1.8.3)
kramdown (1.10.0)
liquid (3.0.6)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.0.0)
minitest (5.9.0)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
nokogiri (1.6.7.2-x86-mingw32)
mini_portile2 (~> 2.0.0.rc2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
public_suffix (1.5.3)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
terminal-table (1.5.2)
thread_safe (0.3.5)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby
x86-mingw32

DEPENDENCIES
github-pages

BUNDLED WITH
1.12.5
17 changes: 17 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Site settings
title: Tableau Server Client Library (Python)
email: github@tableau.com
description: Simplify interactions with the Tableau Server REST API.
baseurl: "/server-client-python"
permalinks: pretty
defaults:
-
scope:
path: "" # Apply to all files
values:
layout: "default"

# Build settings
markdown: kramdown
highlighter: rouge

31 changes: 31 additions & 0 deletions docs/_includes/docs_menu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div class="well docs-menu col-xs-12 col-sm-4 col-md-3">
<ul class="nav nav-list">
<li>
<a href="{{ site.baseurl }}/docs">Get Started</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/sign-in-out">Sign In and Out</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/versions">Versions</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/page-through-results">Page through Results</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/populate-connections-views">Populate Connections and Views</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/filter-sort">Filter and Sort</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/samples">Samples</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/api-ref">API Reference</a>
</li>
<li>
<a href="{{ site.baseurl }}/docs/dev-guide">Developer Guide</a>
</li>
</ul>
</div>
8 changes: 8 additions & 0 deletions docs/_includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Footer -->
<footer>
<div class="row">
<hr class="footer-hr">
<p>This site is open source. Suggestions and pull requests are welcome on our <a href="https://github.com/tableau/server-client-python">GitHub page</a>.</p>
<p>&copy; 2016 Tableau.</p>
</div>
</footer>
15 changes: 15 additions & 0 deletions docs/_includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">

<link rel="shortcut icon" type="image/png" href="{{ site.baseurl }}/assets/logo.png">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/github-highlight.css">

<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
29 changes: 29 additions & 0 deletions docs/_includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<header class="site-header">
<div class="wrapper">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand navbar-brand-logo" href="{{ site.baseurl }}/#">Tableau Server Client (Python)</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="{{ site.baseurl }}/docs/">Docs</a></li>
<li><a href="{{ site.baseurl }}/docs/api-ref">API Reference</a></li>
<li><a target="_blank" href="https://community.tableau.com/community/developers/content">Forum</a></li>
<!-- <li><a href="{{ site.baseurl }}/news/">What's New?</a></li> -->
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="tableauIcon"><a target="_blank" href="http://tableau.com"><img src="{{ site.baseurl }}/assets/logo.png" alt="Tableau Developers" class="logo" /></a></li>
<li><a target="_blank" href="https://github.com/tableau/server-client-python"><span class="icon icon--github" title="Tableau Server Client on GitHub" alt="Tableau Server Client on GitHub">{% include icon-github.svg %}</span></a></li>
</ul>
</div>
</div>
</nav>
</div>
</header>
1 change: 1 addition & 0 deletions docs/_includes/icon-github.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>

<head>
{% include head.html %}
</head>

<body>
<div class="container">
{% include header.html %}
<ul class="blogul">
{% for post in site.posts %}
<div class="row">
<h1>{{ post.title }}</h1>
<hr>
<p><span class="glyphicon glyphicon-time"></span> Posted on {{ post.date | date: "%-d %B %Y" }}</p>
<hr>
<p class="lead">
{{ post.abstract }}
</p>
{% if post.photoname %}
<img class="img-responsive" src="{{ site.baseurl }}/assets/{{ post.photoname}}" alt=""> {% endif %}
<hr>
<div class="blog-content">
{{ post.content }}
</div>
</div>
{% endfor %}
</ul>
{% include footer.html %}
</div>
</body>

</html>
31 changes: 31 additions & 0 deletions docs/_layouts/docs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: docs
---

<!DOCTYPE html>
<html>

<head>
{% include head.html %}
</head>

<body>
<div class="container">
{% include header.html %}
{% include docs_menu.html %}

<div class="content .col-xs-12 .col-sm-8 .col-md-9">
<h1>{{ page.title }}</h1>
<div class="edit-container">
<a href="https://github.com/tableau/server-client-python/edit/master/docs/docs/{{ page.path }}" class="edit-links"><span class="glyphicon glyphicon-pencil"></span> Edit this page</a>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it docs/docs/ {{path}} I think in document-api it's just docs/{{path}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Copypasta problem :) Should be fixed.

&nbsp;
<a href="https://github.com/tableau/server-client-python/issues" class="edit-links"><span class="glyphicon glyphicon-flag"></span> Submit an issue</a>
</div>
<br />
{{ content }}
{% include footer.html %}
</div>
</div>
</body>

</html>