Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
476ca56
Unspecified PDF request option
sfarr15 Mar 26, 2020
a0b9704
Adds description to datasource item
Jun 26, 2020
9541ccd
feat: accept parameters for metadata api
May 23, 2021
146fae9
Merge branch 'development' into metadata/parameters
jacalata Jun 24, 2021
1a25f5c
refactor: corrected line length of files
Jun 24, 2021
13614e7
Update publish.sh to use python3 (#866)
Jul 23, 2021
7586ab1
Add handling for workbooks in personal spaces which will not have pro…
bcantoni Aug 23, 2021
1903d32
Improve tests to show that project_id should be set to something, but…
bcantoni Aug 23, 2021
a910cbb
Add issue template
bcantoni Mar 5, 2021
09917f1
Create slack.yml
jacalata May 24, 2021
00a41fb
whitespace change to re-try PR
jacalata May 24, 2021
6ebf334
Upgrade to newer Slack action provider
bcantoni Sep 1, 2021
1ea39c2
Add Mac and Win to PR testing pipeline
bcantoni Sep 15, 2021
b459994
Merge pull request #885 from tableau/bcantoni-update-environments
bcantoni Sep 17, 2021
b67a804
Revert slack.yml to unblock open PRs
t8y8 Sep 23, 2021
7621389
Merge pull request #900 from tableau/t8y8-patch-1
bcantoni Sep 23, 2021
cd36685
Extend `publish_datasource.py` sample to allow specifying a project n…
vogelsgesang Sep 23, 2021
df481ff
Tests: Verify `datasources.refresh` to return the scheduled job
vogelsgesang Sep 18, 2021
b0e9abf
Remove dead code from `datasources.publish`
vogelsgesang Sep 18, 2021
1c802ee
Use correct JSON Mimetype
vogelsgesang Sep 18, 2021
74bec02
Unify arguments of sample scripts
vogelsgesang Sep 18, 2021
d043e58
Add example for querying metadata API (#895)
vogelsgesang Sep 23, 2021
95bb0ca
Expose the `fileuploads` API endpoint
vogelsgesang Sep 18, 2021
3abe4e9
Make `Fileuploads._read_chunks` exception-safe
vogelsgesang Sep 23, 2021
6547f6b
Merge pull request #889 from vogelsgesang/unify-sample-args
jacalata Sep 23, 2021
78c34f8
Merge branch 'development' into metadata/parameters
jacalata Sep 23, 2021
29a71b0
Merge pull request #850 from Udit107710/metadata/parameters
jacalata Sep 23, 2021
ae56feb
Merge pull request #894 from vogelsgesang/expose-fileuploads
vogelsgesang Sep 23, 2021
5e38225
Merge pull request #875 from tableau/handle-personal-space-workbooks
jacalata Sep 28, 2021
7c03396
Add support for scheduling Data Update jobs (#891)
vogelsgesang Sep 29, 2021
9ac17e4
Rename `datasource.update_data` to `datasource.update_hyper_data` (#906)
vogelsgesang Oct 4, 2021
9ccc713
Add `jobs.wait_for_job` method (#903)
vogelsgesang Oct 6, 2021
a1c3f94
Remove `basestring` hack for Python 2.x compatibility
vogelsgesang Oct 6, 2021
acda7f5
Add missing test assets
vogelsgesang Oct 7, 2021
168638c
Stop supporting Python 3.5
vogelsgesang Oct 7, 2021
69b8cde
Merge pull request #911 from vogelsgesang/remove-python3.5
jacalata Oct 8, 2021
6e3e190
Merge pull request #910 from vogelsgesang/remove-basestring
jacalata Oct 8, 2021
0eed78f
Merge branch 'development' into datasource_desc
jacalata Oct 8, 2021
55dd640
un-re-over-merge
jacalata Oct 9, 2021
072ddb4
Merge pull request #589 from sfarr15/patch-1
jacalata Oct 10, 2021
a8b3424
Merge pull request #912 from tableau/datasource_desc
jacalata Oct 16, 2021
428eb55
Add FlowRun Item and Endpoints. (#884)
jorwoods Oct 19, 2021
46bbe2e
Update contributors and Changelog for Release 0.17 (#920)
mmuttreja-tableau Oct 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug report
about: Create a bug report or request for help
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Versions**
Details of your environment, including:
- Tableau Server version (or note if using Tableau Online)
- Python version
- TSC library version

**To Reproduce**
Steps to reproduce the behavior. Please include a code snippet where possible.

**Results**
What are the results or error messages received?

**NOTE:** Be careful not to post user names, passwords, auth tokens or any other private or sensitive information.
11 changes: 6 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: Python package
name: Python tests

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.2]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.17.0 (20 October 2021)
Update publish.sh to use python3 (#866)
Fixed jobs.get_by_id(job_id) example & reference docs (#867, #868)
Fixed handling for workbooks in personal spaces which do not have projectID or Name (#875)
Updated links to Data Source Methods page in REST API docs (#879)
Upgraded to newer Slack action provider (#880)
Added support to the package for getting flow run status, as well as the ability to cancel flow runs. (#884)

## 0.16.0 (15 July 2021)
* Documentation updates (#800, #818, #839, #842)
* Fixed data alert repr in subscription item (#821)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ The following people have contributed to this project to make it possible, and w
* [Dan Zucker](https://github.com/dzucker-tab)
* [Brian Cantoni](https://github.com/bcantoni)
* [Ovini Nanayakkara](https://github.com/ovinis)
* [Manish Muttreja](https://github.com/mmuttreja-tableau)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Use the Tableau Server Client (TSC) library to increase your productivity as you
* Create users and groups.
* Query projects, sites, and more.

This repository contains Python source code and sample files. Python versions 3.5 and up are supported.
This repository contains Python source code and sample files. Python versions 3.6 and up are supported.

For more information on installing and using TSC, see the documentation:
<https://tableau.github.io/server-client-python/docs/>

3 changes: 1 addition & 2 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -e

rm -rf dist
python setup.py sdist
python setup.py bdist_wheel
python3 setup.py sdist
python3 setup.py bdist_wheel
twine upload dist/*
26 changes: 12 additions & 14 deletions samples/add_default_permission.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
####
# This script demonstrates how to add default permissions using TSC
# To run the script, you must have installed Python 3.5 and later.
# To run the script, you must have installed Python 3.6 or later.
#
# In order to demonstrate adding a new default permission, this sample will create
# a new project and add a new capability to the new project, for the default "All users" group.
Expand All @@ -10,35 +10,33 @@
####

import argparse
import getpass
import logging

import tableauserverclient as TSC


def main():
parser = argparse.ArgumentParser(description='Add workbook default permissions for a given project.')
parser.add_argument('--server', '-s', required=True, help='Server address')
parser.add_argument('--username', '-u', required=True, help='Username to sign into server')
parser.add_argument('--site', '-S', default=None, help='Site to sign into - default site if not provided')
parser.add_argument('-p', default=None, help='Password to sign into server')

# Common options; please keep those in sync across all samples
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--site', '-S', help='site name')
parser.add_argument('--token-name', '-p', required=True,
help='name of the personal access token used to sign into the server')
parser.add_argument('--token-value', '-v', required=True,
help='value of the personal access token used to sign into the server')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')
# Options specific to this sample
# This sample has no additional options, yet. If you add some, please add them here

args = parser.parse_args()

if args.p is None:
password = getpass.getpass("Password: ")
else:
password = args.p

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

# Sign in
tableau_auth = TSC.TableauAuth(args.username, password, args.site)
# Sign in to server
tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):

Expand Down
19 changes: 12 additions & 7 deletions samples/create_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# This script demonstrates how to create a group using the Tableau
# Server Client.
#
# To run the script, you must have installed Python 3.5 or later.
# To run the script, you must have installed Python 3.6 or later.
####


import argparse
import getpass
import logging

from datetime import time
Expand All @@ -18,20 +17,26 @@
def main():

parser = argparse.ArgumentParser(description='Creates a sample user group.')
# Common options; please keep those in sync across all samples
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--site', '-S', help='site name')
parser.add_argument('--token-name', '-p', required=True,
help='name of the personal access token used to sign into the server')
parser.add_argument('--token-value', '-v', required=True,
help='value of the personal access token used to sign into the server')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')
args = parser.parse_args()
# Options specific to this sample
# This sample has no additional options, yet. If you add some, please add them here

password = getpass.getpass("Password: ")
args = parser.parse_args()

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

tableau_auth = TSC.TableauAuth(args.username, password)
server = TSC.Server(args.server)
tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):
group = TSC.GroupItem('test')
group = server.groups.create(group)
Expand Down
25 changes: 11 additions & 14 deletions samples/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
# parent_id.
#
#
# To run the script, you must have installed Python 3.5 or later.
# To run the script, you must have installed Python 3.6 or later.
####

import argparse
import getpass
import logging
import sys

Expand All @@ -27,28 +26,26 @@ def create_project(server, project_item):

def main():
parser = argparse.ArgumentParser(description='Create new projects.')
# Common options; please keep those in sync across all samples
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--site', '-S', default=None)
parser.add_argument('-p', default=None, help='password')

parser.add_argument('--site', '-S', help='site name')
parser.add_argument('--token-name', '-p', required=True,
help='name of the personal access token used to sign into the server')
parser.add_argument('--token-value', '-v', required=True,
help='value of the personal access token used to sign into the server')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')
# Options specific to this sample
# This sample has no additional options, yet. If you add some, please add them here

args = parser.parse_args()

if args.p is None:
password = getpass.getpass("Password: ")
else:
password = args.p

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

tableau_auth = TSC.TableauAuth(args.username, password)
server = TSC.Server(args.server)

tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):
# Use highest Server REST API version available
server.use_server_version()
Expand Down
19 changes: 12 additions & 7 deletions samples/create_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# This script demonstrates how to create schedules using the Tableau
# Server Client.
#
# To run the script, you must have installed Python 3.5 or later.
# To run the script, you must have installed Python 3.6 or later.
####


import argparse
import getpass
import logging

from datetime import time
Expand All @@ -18,20 +17,26 @@
def main():

parser = argparse.ArgumentParser(description='Creates sample schedules for each type of frequency.')
# Common options; please keep those in sync across all samples
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--site', '-S', help='site name')
parser.add_argument('--token-name', '-p', required=True,
help='name of the personal access token used to sign into the server')
parser.add_argument('--token-value', '-v', required=True,
help='value of the personal access token used to sign into the server')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')
args = parser.parse_args()
# Options specific to this sample
# This sample has no additional options, yet. If you add some, please add them here

password = getpass.getpass("Password: ")
args = parser.parse_args()

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

tableau_auth = TSC.TableauAuth(args.username, password)
server = TSC.Server(args.server)
tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):
# Hourly Schedule
# This schedule will run every 2 hours between 2:30AM and 11:00PM
Expand Down
31 changes: 13 additions & 18 deletions samples/download_view_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
# For more information, refer to the documentations on 'Query View Image'
# (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm)
#
# To run the script, you must have installed Python 3.5 or later.
# To run the script, you must have installed Python 3.6 or later.
####

import argparse
import getpass
import logging

import tableauserverclient as TSC
Expand All @@ -18,34 +17,30 @@
def main():

parser = argparse.ArgumentParser(description='Download image of a specified view.')
# Common options; please keep those in sync across all samples
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--site-id', '-si', required=False,
help='content url for site the view is on')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--view-name', '-v', required=True,
parser.add_argument('--site', '-S', help='site name')
parser.add_argument('--token-name', '-p', required=True,
help='name of the personal access token used to sign into the server')
parser.add_argument('--token-value', '-v', required=True,
help='value of the personal access token used to sign into the server')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')
# Options specific to this sample
parser.add_argument('--view-name', '-vn', required=True,
help='name of view to download an image of')
parser.add_argument('--filepath', '-f', required=True, help='filepath to save the image returned')
parser.add_argument('--maxage', '-m', required=False, help='max age of the image in the cache in minutes.')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')

args = parser.parse_args()

password = getpass.getpass("Password: ")

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

# Step 1: Sign in to server.
site_id = args.site_id
if not site_id:
site_id = ""
tableau_auth = TSC.TableauAuth(args.username, password, site_id=site_id)
server = TSC.Server(args.server)
# The new endpoint was introduced in Version 2.5
server.version = "2.5"

tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):
# Step 2: Query for the view that we want an image of
req_option = TSC.RequestOptions()
Expand Down
20 changes: 11 additions & 9 deletions samples/explore_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
####

import argparse
import getpass
import logging

import tableauserverclient as TSC
Expand All @@ -19,25 +18,28 @@
def main():

parser = argparse.ArgumentParser(description='Explore datasource functions supported by the Server API.')
# Common options; please keep those in sync across all samples
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--publish', '-p', metavar='FILEPATH', help='path to datasource to publish')
parser.add_argument('--download', '-d', metavar='FILEPATH', help='path to save downloaded datasource')
parser.add_argument('--site', '-S', help='site name')
parser.add_argument('--token-name', '-p', required=True,
help='name of the personal access token used to sign into the server')
parser.add_argument('--token-value', '-v', required=True,
help='value of the personal access token used to sign into the server')
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')
# Options specific to this sample
parser.add_argument('--publish', metavar='FILEPATH', help='path to datasource to publish')
parser.add_argument('--download', metavar='FILEPATH', help='path to save downloaded datasource')

args = parser.parse_args()

password = getpass.getpass("Password: ")

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

# SIGN IN
tableau_auth = TSC.TableauAuth(args.username, password)
server = TSC.Server(args.server)
server.use_highest_version()
tableau_auth = TSC.PersonalAccessTokenAuth(args.token_name, args.token_value, site_id=args.site)
server = TSC.Server(args.server, use_server_version=True)
with server.auth.sign_in(tableau_auth):
# Query projects for use when demonstrating publishing and updating
all_projects, pagination_item = server.projects.get()
Expand Down
Loading