8000 Merge pull request #22 from tableau/rename-project · acpana/server-client-python@0dab12e · GitHub
[go: up one dir, main page]

Skip to content

Commit 0dab12e

Browse files
authored
Merge pull request tableau#22 from tableau/rename-project
renamining from tableauserverapi to tableauserverclient
2 parents dbae807 + e7e6df6 commit 0dab12e

Some content is hidden

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

52 files changed

+140
-140
lines changed

README.md

Lines changed: 5 additions & 5 deletions

samples/explore_datasource.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
####
1111

1212

13-
import tableauserverapi as TSA
13+
import tableauserverclient as TSC
1414
import os.path
1515
import argparse
1616
import getpass
@@ -32,8 +32,8 @@
3232
logging.basicConfig(level=logging_level)
3333

3434
##### SIGN IN #####
35-
tableau_auth = TSA.TableauAuth(args.username, password)
36-
server = TSA.Server(args.server)
35+
tableau_auth = TSC.TableauAuth(args.username, password)
36+
server = TSC.Server(args.server)
3737
with server.auth.sign_in(tableau_auth):
3838

3939
# Query projects for use when demonstrating publishing and updating
@@ -43,7 +43,7 @@
4343
# Publish datasource if publish flag is set (-publish, -p)
4444
if args.publish:
4545
if default_project is not None:
46-
new_datasource = TSA.DatasourceItem(default_project.id)
46+
new_datasource = TSC.DatasourceItem(default_project.id)
4747
new_datasource = server.datasources.publish(new_datasource, args.publish, server.PublishMode.Overwrite)
4848
print("Datasource published. ID: {}".format(new_datasource.id))
4949
else:

samples/explore_workbook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# on top of the general operations.
1010
####
1111

12-
import tableauserverapi as TSA
12+
import tableauserverclient as TSC
1313
import os.path
1414
import copy
1515
import argparse
@@ -33,8 +33,8 @@
3333
logging.basicConfig(level=logging_level)
3434

3535
##### SIGN IN #####
36-
tableau_auth = TSA.TableauAuth(args.username, password)
37-
server = TSA.Server(args.server)
36+
tableau_auth = TSC.TableauAuth(args.username, password)
37+
server = TSC.Server(args.server)
3838
with server.auth.sign_in(tableau_auth):
3939

4040
# Publish workbook if publish flag is set (-publish, -p)
@@ -43,7 +43,7 @@
4343
default_project = next((project for project in all_projects if project.is_default()), None)
4444

4545
if default_project is not None:
46-
new_workbook = TSA.WorkbookItem(default_project.id)
46+
new_workbook = TSC.WorkbookItem(default_project.id)
4747
new_workbook = server.workbooks.publish(new_workbook, args.publish, server.PublishMode.Overwrite)
4848
print("Workbook published. ID: {}".format(new_workbook.id))
4949
else:

samples/move_workbook_projects.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# To run the script, you must have installed Python 2.7.9 or later.
88
####
99

10-
import tableauserverapi as TSA
10+
import tableauserverclient as TSC
1111
import argparse
1212
import getpass
1313
import logging
@@ -28,13 +28,13 @@
2828
logging.basicConfig(level=logging_level)
2929

3030
# Step 1: Sign in to server
31-
tableau_auth = TSA.TableauAuth(args.username, password)
32-
server = TSA.Server(args.server)
31+
tableau_auth = TSC.TableauAuth(args.username, password)
32+
server = TSC.Server(args.server)
3333
with server.auth.sign_in(tableau_auth):
3434
# Step 2: Query workbook to move
35-
req_option = TSA.RequestOptions()
36-
req_option.filter.add(TSA.Filter(TSA.RequestOptions.Field.Name,
37-
TSA.RequestOptions.Operator.Equals, args.workbook_name))
35+
req_option = TSC.RequestOptions()
36+
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Name,
37+
TSC.RequestOptions.Operator.Equals, args.workbook_name))
3838
pagination_info, all_workbooks = server.workbooks.get(req_option)
3939

4040
# Step 3: Find destination project

samples/move_workbook_sites.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# To run the script, you must have installed Python 2.7.9 or later.
88
####
99

10-
import tableauserverapi as TSA
10+
import tableauserverclient as TSC
1111
import shutil
1212
import argparse
1313
import tempfile
@@ -32,16 +32,16 @@
3232
logging.basicConfig(level=logging_level)
3333

3434
# Step 1: Sign in to both sites on server
35-
tableau_auth = TSA.TableauAuth(args.username, password)
35+
tableau_auth = TSC.TableauAuth(args.username, password)
3636

37-
source_server = TSA.Server(args.server)
38-
dest_server = TSA.Server(args.server)
37+
source_server = TSC.Server(args.server)
38+
dest_server = TSC.Server(args.server)
3939

4040
with source_server.auth.sign_in(tableau_auth):
4141
# Step 2: Query workbook to move
42-
req_option = TSA.RequestOptions()
43-
req_option.filter.add(TSA.Filter(TSA.RequestOptions.Field.Name,
44-
225B TSA.RequestOptions.Operator.Equals, args.workbook_name))
42+
req_option = TSC.RequestOptions()
43+
req_option.filter.add(TSC.Filter(TSC.RequestOptions.Field.Name,
44+
TSC.RequestOptions.Operator.Equals, args.workbook_name))
4545
pagination_info, all_workbooks = source_server.workbooks.get(req_option)
4646

4747
# Step 3: Download workbook to a temp directory
@@ -72,7 +72,7 @@
7272

7373
# Step 6: If default project is found, form a new workbook item and publish.
7474
if target_project is not None:
75-
new_workbook = TSA.WorkbookItem(name=args.workbook_name, project_id=target_project.id)
75+
new_workbook = TSC.WorkbookItem(name=args.workbook_name, project_id=target_project.id)
7676
new_workbook = dest_server.workbooks.publish(new_workbook, workbook_path,
7777
mode=dest_server.PublishMode.Overwrite)
7878
print("Successfully moved {0} ({1})".format(new_workbook.name, new_workbook.id))

samples/publish_workbook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# To run the script, you must have installed Python 2.7.9 or later.
1515
####
1616

17-
import tableauserverapi as TSA
17+
import tableauserverclient as TSC
1818
import argparse
1919
import getpass
2020
import logging
@@ -34,8 +34,8 @@
3434
logging.basicConfig(level=logging_level)
3535

3636
# Step 1: Sign in to server.
37-
tableau_auth = TSA.TableauAuth(args.username, password)
38-
server = TSA.Server(args.server)
37+
tableau_auth = TSC.TableauAuth(args.username, password)
38+
server = TSC.Server(args.server)
3939
with server.auth.sign_in(tableau_auth):
4040

4141
# Step 2: Get all the projects on server, then look for the default one.
@@ -44,7 +44,7 @@
4444

4545
# Step 3: If default project is found, form a new workbook item and publish.
4646
if default_project is not None:
47-
new_workbook = TSA.WorkbookItem(default_project.id)
47+
new_workbook = TSC.WorkbookItem(default_project.id)
4848
new_workbook = server.workbooks.publish(new_workbook, args.filepath, server.PublishMode.Overwrite)
4949
print("Workbook published. ID: {0}".format(new_workbook.id))
5050
else:

samples/set_http_options.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# To run the script, you must have installed Python 2.7.9 or later.
99
####
1010

11-
import tableauserverapi as TSA
11+
import tableauserverclient as TSC
1212
import argparse
1313
import getpass
1414
import logging
@@ -27,8 +27,8 @@
2727
logging.basicConfig(level=logging_level)
2828

2929
# Step 1: Create required objects for sign in
30-
tableau_auth = TSA.TableauAuth(args.username, password)
31-
server = TSA.Server(args.server)
30+
tableau_auth = TSC.TableauAuth(args.username, password)
31+
server = TSC.Server(args.server)
3232

3333
# Step 2: Set http options to disable verifying SSL
3434
server.add_http_options({'verify': False})

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from distutils.core import setup
55

66
setup(
7-
name='tableauserverapi',
7+
name='tableauserverclient',
88
version='0.1',
99
author='Tableau Software',
1010
author_email='github@tableau.com',
11-
url='https://github.com/tableau/server-api-python',
12-
packages=['tableauserverapi', 'tableauserverapi.models', 'tableauserverapi.server',
13-
'tableauserverapi.server.endpoint'],
11+
url='https://github.com/tableau/server-client-python',
12+
packages=['tableauserverclient', 'tableauserverclient.models', 'tableauserverclient.server',
13+
'tableauserverclient.server.endpoint'],
1414
license='MIT',
1515
description='A Python module for working with the Tableau Server REST API.',
1616
test_suite='test',
File renamed without changes.

0 commit comments

Comments
 (0)
0