This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthEndpoint(BaseEndpoint): | |
""" | |
Authorization endpoint for Tableau Server API requests. | |
:param ts_connection: The Tableau Server connection object. | |
:type ts_connection: class | |
:param sign_in: Boolean flag; True if signing in, False otherwise. | |
:type sign_in: boolean | |
:param sign_out: Boolean flag; True if signing out, False otherwise. | |
:type sign_out: boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import requests | |
from requests.packages.urllib3.fields import RequestField | |
from requests.packages.urllib3.filepost import encode_multipart_formdata | |
def _make_multipart(parts): | |
mime_multipart_parts = [] | |
for name, (filename, blob, content_type) in parts.items(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_groups_dataframe | |
NEW_USER_NAME = '<YOUR_NEW_USER_NAME>' | |
NEW_USER_FULL_NAME = '<YOUR_NEW_USER_FULL_NAME>' | |
NEW_USER_EMAIL = '<YOUR_NEW_USER_EMAIL>' | |
NEW_USER_PASSWORD = '<YOUR_NEW_USER_PASSWORD>' # this is listed here for this tutorial, but manage passwords as you see fit | |
GROUP_NAMES = ['YOUR', 'DESIRED', 'GROUP', 'NAMES'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_schedules_dataframe, get_users_dataframe, get_views_dataframe | |
SAMPLE_SCHEDULE_ID = <YOUR_SCHEDULE_ID> | |
SAMPLE_USER_ID = <USER_ID_FOR_USER_SUBSCRIBED> | |
SAMPLE_CONTENT_ID = <VIEW_OR_WORKBOOK_ID_FOR_SUBSCRIPTION> | |
SAMPLE_CONTENT_TYPE = <VIEW_OR_WORKBOOK> # this value can 'view' or 'workbook' and is not case sensitive | |
tableau_server_config = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_groups_dataframe, get_group_users_dataframe, get_schedules_dataframe, \ | |
get_subscriptions_dataframe | |
TEST_GROUP_ID = '<YOUR_GROUP_ID>' | |
TEST_SCHEDULE_ID = '<YOUR_SCHEDULE_ID>' | |
TEST_CONTENT_ID = '<YOUR_VIEW_ID>' | |
TEST_CONTENT_TYPE = 'view' # in this tutorial, my subscription is for a Tableau view | |
TEST_SUBSCRIPTION_SUBJECT = '<YOUR_SUBSCRIPTION_SUBJECT>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_views_dataframe, get_view_data_dataframe | |
VIEW_ID = '<YOUR_VIEW_ID>' | |
CUSTOM_PARAMS = { | |
'region': 'vf_Region=East,West', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_users_dataframe, get_sites_dataframe | |
SITE_NAME_TEXT = '<YOUR_OPTIONAL_SITE_NAME_TEXT>' | |
TABLEAU_SERVER_CONFIG = { | |
'my_env': { | |
'server': 'https://YourTableauServer.com', | |
'api_version': '<YOUR_API_VERSION>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableau_api_lib import TableauServerConnection | |
from tableau_api_lib.utils.querying import get_schedules_dataframe | |
from tableau_api_lib.utils.cloning import clone_schedules | |
TABLEAU_SERVER_CONFIG = { | |
'my_env': { | |
'server': 'https://<YOUR_SERVER>.com', | |
'api_version': '<YOUR_API_VERSION>', | |
'username': '<YOUR_USERNAME>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tableauhyperapi import HyperProcess, Connection, TableDefinition, SqlType, Telemetry, Inserter, CreateMode, TableName | |
from tableauhyperapi import escape_string_literal | |
PATH_TO_CSV = 'sample_csv_for_hyper.csv' | |
PATH_TO_HYPER = 'test_hyper_extract_api.hyper' | |
# Step 1: Start a new private local Hyper instance | |
with HyperProcess(Telemetry.SEND_USAGE_DATA_TO_TABLEAU, 'myapp' ) as hyper: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from tableauhyperapi import HyperProcess, Connection, TableDefinition, SqlType, Telemetry, Inserter, CreateMode, TableName | |
from tableauhyperapi import escape_string_literal | |
PATH_TO_CSV = 'sample_csv_for_hyper.csv' | |
PATH_TO_HYPER = 'test_hyper_extract_api.hyper' | |
OlderNewer