Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4cbd800
Fixes login sample to pass in sitename for username/password auth
Jul 21, 2020
f972ea6
Create notes property from XML response (#571)
jorwoods Jul 21, 2020
ccbbc49
Fixes default sitename in login sample and adds more print statements…
Jul 22, 2020
803d257
Minor edits and cleanup
bcantoni Aug 5, 2020
60539c5
Rename a duplicate test method so they all run
bcantoni Aug 5, 2020
7803a6e
Cleanup test comments and descriptions, no functional changes
bcantoni Aug 5, 2020
12aacb9
Add support for Python 3.8
bcantoni Aug 5, 2020
9240eb8
Merge pull request #659 from tableau/minor-cleanup-pass
bcantoni Aug 6, 2020
4a14d39
Implement server.users.populate_favorites (#656)
jorwoods Aug 11, 2020
ce078cb
Enable switch site functionality (#655)
jorwoods Aug 11, 2020
d666f08
Create Data Alert capabilities
jorwoods Aug 13, 2020
9b17bd4
Test data alerts
jorwoods Aug 13, 2020
036322b
Improve repr on data_alert
jorwoods Aug 13, 2020
0133207
Added webpage url to workbooks (#661)
rshide Aug 14, 2020
3f1b851
Resolve comments
jorwoods Aug 14, 2020
f8799ba
parse_datetime() should gracefully handle invalid dates (#529)
paulvic Aug 14, 2020
972f10a
Change update_permission endpoint for consistency (#668)
jorwoods Aug 14, 2020
d205b4c
CamelCase consistency
jorwoods Aug 14, 2020
79c355a
Validate property values
jorwoods Aug 14, 2020
c395c18
create/delete encrypted extracts for ds and wb
jacalata Aug 19, 2020
bfe49c7
fix merge
jacalata Aug 19, 2020
fb3e6ff
fixup! fix merge
jacalata Aug 19, 2020
fdc403b
remove randomly added typo
jacalata Aug 19, 2020
12ca9fe
ran through pycodestyle
jacalata Aug 19, 2020
81c795b
Update test_workbook.py
jacalata Aug 19, 2020
b355c8f
Merge pull request #672 from tableau/extracts
jacalata Aug 21, 2020
a92e484
implement ad groups and group options
jacalata Aug 23, 2020
0ffc33e
with another test
jacalata Aug 23, 2020
6e3f96d
pycodestyle
jacalata Aug 23, 2020
a90fcf2
tyler feedback
jacalata Aug 29, 2020
c5a5d75
Merge pull request #674 from tableau/bulk-users
jacalata Aug 29, 2020
17c3346
Merge pull request #667 from jorwoods/jorwoods/data_alerts
jacalata Aug 29, 2020
3846bd4
Update setup.py (#650)
t8y8 Aug 31, 2020
2229843
Updates changelog and contributors file for v0.13 (#684)
Sep 1, 2020
168489c
Merge branch 'master' into development
Sep 2, 2020
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ ENV/
# Rope project settings
.ropeproject


# VSCode project settings
.vscode/

# macOS.gitignore from https://github.com/github/gitignore
*.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
# command to install dependencies
install:
- "pip install -e ."
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.13 (1 Sept 2020)
* Added notes field to JobItem (#571)
* Added webpage_url field to WorkbookItem (#661)
* Added support for switching between sites (#655)
* Added support for querying favorites for a user (#656)
* Added support for Python 3.8 (#659)
* Added support for Data Alerts (#667)
* Added support for basic Extract operations - Create, Delete, en/re/decrypt for site (#672)
* Added support for creating and querying Active Directory groups (#674)
* Added support for asynchronously updating a group (#674)
* Improved handling of invalid dates (#529)
* Improved consistency of update_permission endpoints (#668)
* Documentation updates (#658, #669, #670, #673, #683)

## 0.12.1 (22 July 2020)

* Fixed login.py sample to properly handle sitename (#652)
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ The following people have contributed to this project to make it possible, and w
* [Jordan Woods](https://github.com/jorwoods)
* [Reba Magier](https://github.com/rmagier1)
* [Stephen Mitchell](https://github.com/scuml)
* [absentmoose](https://github.com/absentmoose)
* [Paul Vickers](https://github.com/paulvic)

## Core Team

Expand All @@ -49,3 +51,4 @@ The following people have contributed to this project to make it possible, and w
* [Priya Reguraman](https://github.com/preguraman)
* [Jac Fitzgerald](https://github.com/jacalata)
* [Dan Zucker](https://github.com/dzucker-tab)
* [Brian Cantoni](https://github.com/bcantoni)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Tableau Server Client (Python)
[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools)

[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools) [![Build Status](https://travis-ci.org/tableau/server-client-python.svg?branch=master)](https://travis-ci.org/tableau/server-client-python)

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:

* Publish workbooks and data sources.
* Create users and groups.
* Query projects, sites, and more.

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

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

<https://tableau.github.io/server-client-python/docs/>
27 changes: 16 additions & 11 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ a feature do not require the CLA.

## Issues and Feature Requests

To submit an issue/bug report, or to request a feature, please submit a [github issue](https://github.com/tableau/server-client-python/issues) to the repo.
To submit an issue/bug report, or to request a feature, please submit a [GitHub issue](https://github.com/tableau/server-client-python/issues) to the repo.

If you are submitting a bug report, please provide as much information as you can, including clear and concise repro steps, attaching any necessary
files to assist in the repro. **Be sure to scrub the files of any potentially sensitive information. Issues are public.**
Expand Down Expand Up @@ -48,19 +48,24 @@ anyone can add to an issue:
## Fixes, Implementations, and Documentation

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
creating a PR can be found in the [Development Guide](https://tableau.github.io/server-client-python/docs/dev-guide)
creating a PR can be found in the [Development Guide](https://tableau.github.io/server-client-python/docs/dev-guide).

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
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
somewhere.


## Getting Started
> pip install versioneer
> python setup.py build
> python setup.py test
>

### before committing
Our CI runs include a python lint run, so you should run this locally and fix complaints before committing as this will fail your checkin
> pycodestyle tableauserverclient test samples

```shell
pip install versioneer
python setup.py build
python setup.py test
```

### Before Committing

Our CI runs include a Python lint run, so you should run this locally and fix complaints before committing as this will fail your checkin.

```shell
pycodestyle tableauserverclient test samples
```
2 changes: 1 addition & 1 deletion samples/add_default_permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def main():
parser = argparse.ArgumentParser(description='Add workbook default permission for a given project')
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')
Expand Down
4 changes: 2 additions & 2 deletions samples/create_group.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####
# This script demonstrates how to create groups using the Tableau
# 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.
Expand All @@ -17,7 +17,7 @@

def main():

parser = argparse.ArgumentParser(description='Creates sample schedules for each type of frequency.')
parser = argparse.ArgumentParser(description='Creates a sample user group.')
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('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
Expand Down
2 changes: 1 addition & 1 deletion samples/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def create_project(server, project_item):


def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
parser = argparse.ArgumentParser(description='Create new projects.')
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)
Expand Down
2 changes: 1 addition & 1 deletion samples/download_view_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

def main():

parser = argparse.ArgumentParser(description='Query View Image From Server')
parser = argparse.ArgumentParser(description='Download image of a specified view.')
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')
Expand Down
9 changes: 8 additions & 1 deletion samples/export.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
####
# This script demonstrates how to export a view using the Tableau
# Server Client.
#
# To run the script, you must have installed Python 3.5 or later.
####

import argparse
import getpass
import logging
Expand All @@ -6,7 +13,7 @@


def main():
parser = argparse.ArgumentParser(description='Export a view as an image, pdf, or csv')
parser = argparse.ArgumentParser(description='Export a view as an image, PDF, or CSV')
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)
Expand Down
7 changes: 5 additions & 2 deletions samples/export_wb.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#
####
# This sample uses the PyPDF2 library for combining pdfs together to get the full pdf for all the views in a
# workbook.
#
# You will need to do `pip install PyPDF2` to use this sample.
#
# To run the script, you must have installed Python 3.5 or later.
####


import argparse
import getpass
Expand Down Expand Up @@ -48,7 +51,7 @@ def cleanup(tempdir):


def main():
parser = argparse.ArgumentParser(description='Export to PDF all of the views in a workbook')
parser = argparse.ArgumentParser(description='Export to PDF all of the views in a workbook.')
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--site', '-S', default=None, help='Site to log into, do not specify for default site')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
Expand Down
4 changes: 2 additions & 2 deletions samples/filter_sort_groups.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####
# This script demonstrates how to filter groups using the Tableau
# This script demonstrates how to filter and sort groups using the Tableau
# Server Client.
#
# To run the script, you must have installed Python 3.5 or later.
Expand All @@ -24,7 +24,7 @@ def create_example_group(group_name='Example Group', server=None):


def main():
parser = argparse.ArgumentParser(description='Filter on groups')
parser = argparse.ArgumentParser(description='Filter and sort groups.')
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('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
Expand Down
3 changes: 1 addition & 2 deletions samples/filter_sort_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# This script demonstrates how to use the Tableau Server Client
# to filter and sort on the name of the projects present on site.
#
#
# To run the script, you must have installed Python 3.5 or later.
####

Expand All @@ -26,7 +25,7 @@ def create_example_project(name='Example Project', content_permissions='LockedTo


def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
parser = argparse.ArgumentParser(description='Filter and sort projects.')
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)
Expand Down
2 changes: 1 addition & 1 deletion samples/kill_all_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def main():
parser = argparse.ArgumentParser(description='Cancel all of the running background jobs')
parser = argparse.ArgumentParser(description='Cancel all of the running background jobs.')
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--site', '-S', default=None, help='site to log into, do not specify for default site')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
Expand Down
2 changes: 1 addition & 1 deletion samples/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def main():
parser = argparse.ArgumentParser(description='List out the names and LUIDs for different resource types')
parser = argparse.ArgumentParser(description='List out the names and LUIDs for different resource types.')
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--site', '-S', default="", help='site to log into, do not specify for default site')
parser.add_argument('--token-name', '-n', required=True, help='username to signin under')
Expand Down
2 changes: 1 addition & 1 deletion samples/pagination_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def main():

parser = argparse.ArgumentParser(description='Return a list of all of the workbooks on your server')
parser = argparse.ArgumentParser(description='Demonstrate pagination on the list of workbooks on the server.')
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('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
Expand Down
2 changes: 1 addition & 1 deletion samples/query_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def main():
parser = argparse.ArgumentParser(description='Query permissions of a given resource')
parser = argparse.ArgumentParser(description='Query permissions of a given resource.')
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')
Expand Down
2 changes: 1 addition & 1 deletion samples/refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
parser = argparse.ArgumentParser(description='Trigger a refresh task on a workbook or datasource.')
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)
Expand Down
10 changes: 9 additions & 1 deletion samples/set_refresh_schedule.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
####
# This script demonstrates how to set the refresh schedule for
# a workbook or datasource.
#
# To run the script, you must have installed Python 3.5 or later.
####


import argparse
import getpass
import logging
Expand All @@ -6,7 +14,7 @@


def usage(args):
parser = argparse.ArgumentParser(description='Explore workbook functions supported by the Server API.')
parser = argparse.ArgumentParser(description='Set refresh schedule for a workbook or datasource.')
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('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
setup_requires=pytest_runner,
install_requires=[
'requests>=2.11,<3.0',
'urllib3>=1.24.3,<2.0'
],
tests_require=[
'requests-mock>=1.0,<2.0',
Expand Down
2 changes: 1 addition & 1 deletion tableauserverclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .namespace import NEW_NAMESPACE as DEFAULT_NAMESPACE
from .models import ConnectionCredentials, ConnectionItem, DatasourceItem,\
from .models import ConnectionCredentials, ConnectionItem, DataAlertItem, DatasourceItem,\
GroupItem, JobItem, BackgroundJobItem, PaginationItem, ProjectItem, ScheduleItem,\
SiteItem, TableauAuth, PersonalAccessTokenAuth, UserItem, ViewItem, WorkbookItem, UnpopulatedPropertyError,\
HourlyInterval, DailyInterval, WeeklyInterval, MonthlyInterval, IntervalItem, TaskItem,\
Expand Down
8 changes: 7 additions & 1 deletion tableauserverclient/datetime_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ def parse_datetime(date):
if date is None:
return None

return datetime.datetime.strptime(date, TABLEAU_DATE_FORMAT).replace(tzinfo=utc)
try:
return datetime.datetime.strptime(date, TABLEAU_DATE_FORMAT).replace(tzinfo=utc)
except ValueError:
return None


def format_datetime(date):
if date is None:
return None

return date.astimezone(tz=utc).strftime(TABLEAU_DATE_FORMAT)
1 change: 1 addition & 0 deletions tableauserverclient/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .connection_item import ConnectionItem
from .column_item import ColumnItem
from .data_acceleration_report_item import DataAccelerationReportItem
from .data_alert_item import DataAlertItem
from .datasource_item import DatasourceItem
from .database_item import DatabaseItem
from .exceptions import UnpopulatedPropertyError
Expand Down
Loading