Skip to content

Commit 273af7a

Browse files
author
Chris Shin
authored
Merge pull request #685 from tableau/development
[v0.13] Merge development into master 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)
2 parents 43e1b06 + 168489c commit 273af7a

Some content is hidden

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

63 files changed

+1057
-77
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ ENV/
9292
# Rope project settings
9393
.ropeproject
9494

95-
95+
# VSCode project settings
96+
.vscode/
9697

9798
# macOS.gitignore from https://github.com/github/gitignore
9899
*.DS_Store

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python:
44
- "3.5"
55
- "3.6"
66
- "3.7"
7+
- "3.8"
78
# command to install dependencies
89
install:
910
- "pip install -e ."

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 0.13 (1 Sept 2020)
2+
* Added notes field to JobItem (#571)
3+
* Added webpage_url field to WorkbookItem (#661)
4+
* Added support for switching between sites (#655)
5+
* Added support for querying favorites for a user (#656)
6+
* Added support for Python 3.8 (#659)
7+
* Added support for Data Alerts (#667)
8+
* Added support for basic Extract operations - Create, Delete, en/re/decrypt for site (#672)
9+
* Added support for creating and querying Active Directory groups (#674)
10+
* Added support for asynchronously updating a group (#674)
11+
* Improved handling of invalid dates (#529)
12+
* Improved consistency of update_permission endpoints (#668)
13+
* Documentation updates (#658, #669, #670, #673, #683)
14+
115
## 0.12.1 (22 July 2020)
216

317
* Fixed login.py sample to properly handle sitename (#652)

CONTRIBUTORS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ The following people have contributed to this project to make it possible, and w
3737
* [Jordan Woods](https://github.com/jorwoods)
3838
* [Reba Magier](https://github.com/rmagier1)
3939
* [Stephen Mitchell](https://github.com/scuml)
40+
* [absentmoose](https://github.com/absentmoose)
41+
* [Paul Vickers](https://github.com/paulvic)
4042

4143
## Core Team
4244

@@ -49,3 +51,4 @@ The following people have contributed to this project to make it possible, and w
4951
* [Priya Reguraman](https://github.com/preguraman)
5052
* [Jac Fitzgerald](https://github.com/jacalata)
5153
* [Dan Zucker](https://github.com/dzucker-tab)
54+
* [Brian Cantoni](https://github.com/bcantoni)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Tableau Server Client (Python)
2-
[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools)
2+
3+
[![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)
34

45
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:
56

67
* Publish workbooks and data sources.
78
* Create users and groups.
89
* Query projects, sites, and more.
910

10-
This repository contains Python source code and sample files.
11+
This repository contains Python source code and sample files. Python versions 3.5 and up are supported.
1112

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

contributing.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ a feature do not require the CLA.
1515

1616
## Issues and Feature Requests
1717

18-
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.
18+
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.
1919

2020
If you are submitting a bug report, please provide as much information as you can, including clear and concise repro steps, attaching any necessary
2121
files to assist in the repro. **Be sure to scrub the files of any potentially sensitive information. Issues are public.**
@@ -48,19 +48,24 @@ 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 [Development Guide](https://tableau.github.io/server-client-python/docs/dev-guide)
51+
creating a PR can be found in the [Development Guide](https://tableau.github.io/server-client-python/docs/dev-guide).
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
5555
somewhere.
5656

57-
5857
## Getting Started
59-
> pip install versioneer
60-
> python setup.py build
61-
> python setup.py test
62-
>
63-
64-
### before committing
65-
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
66-
> pycodestyle tableauserverclient test samples
58+
59+
```shell
60+
pip install versioneer
61+
python setup.py build
62+
python setup.py test
63+
```
64+
65+
### Before Committing
66+
67+
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.
68+
69+
```shell
70+
pycodestyle tableauserverclient test samples
71+
```

samples/add_default_permission.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

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

samples/create_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####
2-
# This script demonstrates how to create groups using the Tableau
2+
# This script demonstrates how to create a group using the Tableau
33
# Server Client.
44
#
55
# To run the script, you must have installed Python 3.5 or later.
@@ -17,7 +17,7 @@
1717

1818
def main():
1919

20-
parser = argparse.ArgumentParser(description='Creates sample schedules for each type of frequency.')
20+
parser = argparse.ArgumentParser(description='Creates a sample user group.')
2121
parser.add_argument('--server', '-s', required=True, help='server address')
2222
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
2323
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',

samples/create_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def create_project(server, project_item):
2626

2727

2828
def main():
29-
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
29+
parser = argparse.ArgumentParser(description='Create new projects.')
3030
parser.add_argument('--server', '-s', required=True, help='server address')
3131
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
3232
parser.add_argument('--site', '-S', default=None)

samples/download_view_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
def main():
1919

20-
parser = argparse.ArgumentParser(description='Query View Image From Server')
20+
parser = argparse.ArgumentParser(description='Download image of a specified view.')
2121
parser.add_argument('--server', '-s', required=True, help='server address')
2222
parser.add_argument('--site-id', '-si', required=False,
2323
help='content url for site the view is on')

samples/export.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
####
2+
# This script demonstrates how to export a view using the Tableau
3+
# Server Client.
4+
#
5+
# To run the script, you must have installed Python 3.5 or later.
6+
####
7+
18
import argparse
29
import getpass
310
import logging
@@ -6,7 +13,7 @@
613

714

815
def main():
9-
parser = argparse.ArgumentParser(description='Export a view as an image, pdf, or csv')
16+
parser = argparse.ArgumentParser(description='Export a view as an image, PDF, or CSV')
1017
parser.add_argument('--server', '-s', required=True, help='server address')
1118
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
1219
parser.add_argument('--site', '-S', default=None)

samples/export_wb.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
#
1+
####
22
# This sample uses the PyPDF2 library for combining pdfs together to get the full pdf for all the views in a
33
# workbook.
44
#
55
# You will need to do `pip install PyPDF2` to use this sample.
66
#
7+
# To run the script, you must have installed Python 3.5 or later.
8+
####
9+
710

811
import argparse
912
import getpass
@@ -48,7 +51,7 @@ def cleanup(tempdir):
4851

4952

5053
def main():
51-
parser = argparse.ArgumentParser(description='Export to PDF all of the views in a workbook')
54+
parser = argparse.ArgumentParser(description='Export to PDF all of the views in a workbook.')
5255
parser.add_argument('--server', '-s', required=True, help='server address')
5356
parser.add_argument('--site', '-S', default=None, help='Site to log into, do not specify for default site')
5457
parser.add_argument('--username', '-u', required=True, help='username to sign into server')

samples/filter_sort_groups.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####
2-
# This script demonstrates how to filter groups using the Tableau
2+
# This script demonstrates how to filter and sort groups using the Tableau
33
# Server Client.
44
#
55
# To run the script, you must have installed Python 3.5 or later.
@@ -24,7 +24,7 @@ def create_example_group(group_name='Example Group', server=None):
2424

2525

2626
def main():
27-
parser = argparse.ArgumentParser(description='Filter on groups')
27+
parser = argparse.ArgumentParser(description='Filter and sort groups.')
2828
parser.add_argument('--server', '-s', required=True, help='server address')
2929
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
3030
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',

samples/filter_sort_projects.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# This script demonstrates how to use the Tableau Server Client
33
# to filter and sort on the name of the projects present on site.
44
#
5-
#
65
# To run the script, you must have installed Python 3.5 or later.
76
####
87

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

2726

2827
def main():
29-
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
28+
parser = argparse.ArgumentParser(description='Filter and sort projects.')
3029
parser.add_argument('--server', '-s', required=True, help='server address')
3130
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
3231
parser.add_argument('--site', '-S', default=None)

samples/kill_all_jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def main():
15-
parser = argparse.ArgumentParser(description='Cancel all of the running background jobs')
15+
parser = argparse.ArgumentParser(description='Cancel all of the running background jobs.')
1616
parser.add_argument('--server', '-s', required=True, help='server address')
1717
parser.add_argument('--site', '-S', default=None, help='site to log into, do not specify for default site')
1818
parser.add_argument('--username', '-u', required=True, help='username to sign into server')

samples/list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def main():
17-
parser = argparse.ArgumentParser(description='List out the names and LUIDs for different resource types')
17+
parser = argparse.ArgumentParser(description='List out the names and LUIDs for different resource types.')
1818
parser.add_argument('--server', '-s', required=True, help='server address')
1919
parser.add_argument('--site', '-S', default="", help='site to log into, do not specify for default site')
2020
parser.add_argument('--token-name', '-n', required=True, help='username to signin under')

samples/pagination_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def main():
2121

22-
parser = argparse.ArgumentParser(description='Return a list of all of the workbooks on your server')
22+
parser = argparse.ArgumentParser(description='Demonstrate pagination on the list of workbooks on the server.')
2323
parser.add_argument('--server', '-s', required=True, help='server address')
2424
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
2525
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',

samples/query_permissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def main():
17-
parser = argparse.ArgumentParser(description='Query permissions of a given resource')
17+
parser = argparse.ArgumentParser(description='Query permissions of a given resource.')
1818
parser.add_argument('--server', '-s', required=True, help='Server address')
1919
parser.add_argument('--username', '-u', required=True, help='Username to sign into server')
2020
parser.add_argument('--site', '-S', default=None, help='Site to sign into - default site if not provided')

samples/refresh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def main():
15-
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
15+
parser = argparse.ArgumentParser(description='Trigger a refresh task on a workbook or datasource.')
1616
parser.add_argument('--server', '-s', required=True, help='server address')
1717
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
1818
parser.add_argument('--site', '-S', default=None)

samples/set_refresh_schedule.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
####
2+
# This script demonstrates how to set the refresh schedule for
3+
# a workbook or datasource.
4+
#
5+
# To run the script, you must have installed Python 3.5 or later.
6+
####
7+
8+
19
import argparse
210
import getpass
311
import logging
@@ -6,7 +14,7 @@
614

715

816
def usage(args):
9-
parser = argparse.ArgumentParser(description='Explore workbook functions supported by the Server API.')
17+
parser = argparse.ArgumentParser(description='Set refresh schedule for a workbook or datasource.')
1018
parser.add_argument('--server', '-s', required=True, help='server address')
1119
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
1220
parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
setup_requires=pytest_runner,
3434
install_requires=[
3535
'requests>=2.11,<3.0',
36-
'urllib3>=1.24.3,<2.0'
3736
],
3837
tests_require=[
3938
'requests-mock>=1.0,<2.0',

tableauserverclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .namespace import NEW_NAMESPACE as DEFAULT_NAMESPACE
2-
from .models import ConnectionCredentials, ConnectionItem, DatasourceItem,\
2+
from .models import ConnectionCredentials, ConnectionItem, DataAlertItem, DatasourceItem,\
33
GroupItem, JobItem, BackgroundJobItem, PaginationItem, ProjectItem, ScheduleItem,\
44
SiteItem, TableauAuth, PersonalAccessTokenAuth, UserItem, ViewItem, WorkbookItem, UnpopulatedPropertyError,\
55
HourlyInterval, DailyInterval, WeeklyInterval, MonthlyInterval, IntervalItem, TaskItem,\

tableauserverclient/datetime_helpers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,14 @@ def parse_datetime(date):
2828
if date is None:
2929
return None
3030

31-
return datetime.datetime.strptime(date, TABLEAU_DATE_FORMAT).replace(tzinfo=utc)
31+
try:
32+
return datetime.datetime.strptime(date, TABLEAU_DATE_FORMAT).replace(tzinfo=utc)
33+
except ValueError:
34+
return None
3235

3336

3437
def format_datetime(date):
38+
if date is None:
39+
return None
40+
3541
return date.astimezone(tz=utc).strftime(TABLEAU_DATE_FORMAT)

tableauserverclient/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from .connection_item import ConnectionItem
33
from .column_item import ColumnItem
44
from .data_acceleration_report_item import DataAccelerationReportItem
5+
from .data_alert_item import DataAlertItem
56
from .datasource_item import DatasourceItem
67
from .database_item import DatabaseItem
78
from .exceptions import UnpopulatedPropertyError

0 commit comments

Comments
 (0)