Skip to content

Commit

Permalink
Merge pull request bryanthowell-tableau#77 from bryantbhowell/5.0.6
Browse files Browse the repository at this point in the history
5.0.6
  • Loading branch information
Bryant Howell authored Dec 9, 2019
2 parents 69aad71 + 3e76213 commit f216a5e
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ If you just import tableau_tools per the following, you will have access to the
If you need to use tableau_documents, use the following import statements:

from tableau_tools import *
from tableau_documents import *
from tableau_tools.tableau_documents import *

### 0.2 Logger class
The Logger class implements useful and verbose logging to a plain text file that all of the other objects can use. You declare a single Logger object, then pass it to the other objects, resulting in a single continuous log file of all actions.
Expand Down
1 change: 0 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
#from .tableau._server_rest import TableauServerRest, TableauServerRest33
from .tableau_rest_api_connection import *
from .tableau_server_rest import *
import tableau_documents
4 changes: 2 additions & 2 deletions examples/hyper_api_samples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from tableau_tools import *
from tableau_documents import *
from tableau_documents.hyper_file_generator import HyperFileGenerator
from tableau_tools.tableau_documents import *
from tableau_tools.tableau_documents.hyper_file_generator import HyperFileGenerator

import pyodbc
import sys
Expand Down
2 changes: 1 addition & 1 deletion examples/replicate_site_structure_sample.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from tableau_tools import *
from tableau_documents import *
from tableau_tools.tableau_documents import *
import time
import os

Expand Down
18 changes: 17 additions & 1 deletion examples/template_publish_sample.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from tableau_tools import *
from tableau_documents import *
from tableau_tools.tableau_documents import *

import datetime
import os
Expand Down Expand Up @@ -90,6 +90,22 @@ def promote_from_dev_to_test(logger_obj=None):

# promote_from_dev_to_test(logger)

# This function shows changing out a Hyper file in an existing packaged workbook
# It assumes you have used the Hyper API at least once to generate a Hyper file, then used Tableau Desktop to connect
# to that Hyper file, and saved a packaged file (TWBX or TDSX) with that file
def hyper_api_swap_example(logger_obj = None):
newly_built_hyper_filename = 'Replacement Hyper File.hyper'
t_file = TableauFileManager.open(filename='Packaged File.tdsx', logger_obj=logger_obj)
filenames = t_file.get_filenames_in_package()
for filename in filenames:
# Find my Hyper file
if filename.lower.find('.hyper') != -1:
t_file.set_file_for_replacement(filename_in_package=filename,
replacement_filname_on_disk=newly_built_hyper_filename)
break # Breaking here on a TDSX, but you could do a whole mapping I suppose to replace multiples in a TDSX

t_file.save_new_file(new_filename_no_extension='Updated Packaged File')

# This function shows publishing multiple workbooks from a single project
# which will also publish across any published data sources that are linked
# This is a complex algorithm but is necessary for working with published data sources
Expand Down
2 changes: 1 addition & 1 deletion examples/test_suite_tableau_documents.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tableau_tools import *
from tableau_documents import *
from tableau_tools.tableau_documents import *

#
# WIP and will be more fully built out in the future. See template_publish_sample.py for other uses as well as the README
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
setup(
name='tableau_tools',
python_requires='>=3.6',
version='5.0.4',
packages=['tableau_tools', 'tableau_tools.tableau_rest_api', 'tableau_tools.tableau_documents', 'tableau_tools.examples'],
version='5.0.6',
packages=['tableau_tools', 'tableau_tools.tableau_rest_api', 'tableau_tools.tableau_documents',
'tableau_tools.examples', 'tableau_tools.tableau_rest_api.methods'],
url='https://github.com/bryantbhowell/tableau_tools',
license='',
author='Bryant Howell',
Expand Down
2 changes: 1 addition & 1 deletion tableau_documents/tableau_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tableau_tools.logger import Logger
from tableau_tools.logging_methods import LoggingMethods

from tableau_documents.tableau_parameters import TableauParameter
from .tableau_parameters import TableauParameter


class TableauColumns(LoggingMethods):
Expand Down
8 changes: 4 additions & 4 deletions tableau_documents/tableau_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from tableau_tools.tableau_exceptions import *
from tableau_tools.logger import Logger
from tableau_tools.logging_methods import LoggingMethods
from tableau_documents.tableau_connection import TableauConnection
from tableau_documents.tableau_document import TableauDocument
from tableau_documents.tableau_columns import TableauColumns
from tableau_documents.table_relations import TableRelations
from .tableau_connection import TableauConnection
from .tableau_document import TableauDocument
from .tableau_columns import TableauColumns
from .table_relations import TableRelations


# Meant to represent a TDS file, does not handle the file opening
Expand Down
1 change: 0 additions & 1 deletion tableau_documents/tableau_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def __init__(self, parameter_xml: Optional[ET.Element] = None, parameter_number:
logger_obj: Optional[Logger] = None, name: Optional[str] = None, datatype: Optional[str] = None,
current_value: Optional[str] = None):

TableauBase.__init__(self)
self.logger = logger_obj
self._aliases = False
self._values_list = None
Expand Down
2 changes: 1 addition & 1 deletion tableau_rest_api/methods/metadata.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .rest_api_base import *
from tableau_rest_api.permissions import DatabasePermissions35, TablePermissions35
from ..permissions import DatabasePermissions35, TablePermissions35
import json


Expand Down
2 changes: 2 additions & 0 deletions tableau_rest_api/methods/schedule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from .rest_api_base import *


class ScheduleMethods():
def __init__(self, rest_api_base: TableauRestApiBase):
self.rest_api_base = rest_api_base
Expand Down
4 changes: 3 additions & 1 deletion tableau_rest_api/methods/subscription.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from .rest_api_base import *
from requests.exceptions import HTTPError

from .rest_api_base import *

class SubscriptionMethods():
def __init__(self, rest_api_base: TableauRestApiBase):
self.rest_api_base = rest_api_base
Expand Down

0 comments on commit f216a5e

Please sign in to comment.