Repository: tableau/server-client-python

Issue:
AttributeError: module 'tableauserverclient' has no attribute 'ExcelRequestOptions'
**Describe the bug**
AttributeError: module 'tableauserverclient' has no attribute 'ExcelRequestOptions'

**Versions**
Details of your environment, including:
 - Tableau Server version 2022.1.6
 - Python version v.3.9
 - TSC library version 0.20

**To Reproduce**
python C:\Users\jxxxx01\Downloads\Tableau\Tidal\server-client-python-master\samples\export.v.1.0.py -s http://tabxxxx.mybsc.com --site "" -u svcUser --xlsx -f “C:\Users\jxxxx01\Downloads\Tableau\Installation_and_Billing\LEP-python.xlsx” 8834ac6b-xxxx-xxxx-xxxx-xxxx

**Results**
Signing in...
Server: http://tabxxxx.mybsc.com
Site:
Username: svcUser
Connected
Item found: Group Calpers LEP Dashboard
Traceback (most recent call last):
  File "C:\Users\jxxxx01\Downloads\Tableau\Tidal\server-client-python-master\samples\export.v.1.0.py", line 127, in <module>
    main()
  File "C:\Users\jxxxx01\Downloads\Tableau\Tidal\server-client-python-master\samples\export.v.1.0.py", line 105, in main
    option_factory = getattr(TSC, option_factory_name)
AttributeError: module 'tableauserverclient' has no attribute 'ExcelRequestOptions'


Discussion:

Patch:
diff --git a/tableauserverclient/__init__.py b/tableauserverclient/__init__.py
index 3941841..7c1e6d7 100644
--- a/tableauserverclient/__init__.py
+++ b/tableauserverclient/__init__.py
@@ -39,6 +39,7 @@ from .models import (
 )
 from .server import (
     CSVRequestOptions,
+    ExcelRequestOptions,
     ImageRequestOptions,
     PDFRequestOptions,
     RequestOptions,
diff --git a/tableauserverclient/server/__init__.py b/tableauserverclient/server/__init__.py
index 25abb3c..84d118a 100644
--- a/tableauserverclient/server/__init__.py
+++ b/tableauserverclient/server/__init__.py
@@ -2,6 +2,7 @@
 from .request_factory import RequestFactory
 from .request_options import (
     CSVRequestOptions,
+    ExcelRequestOptions,
     ImageRequestOptions,
     PDFRequestOptions,
     RequestOptions,


Test patch:
diff --git a/test/test_view.py b/test/test_view.py
index 3562650..f5d3db4 100644
--- a/test/test_view.py
+++ b/test/test_view.py
@@ -294,7 +294,7 @@ class ViewTests(unittest.TestCase):
             m.get(self.baseurl + "/d79634e1-6063-4ec9-95ff-50acbf609ff5/crosstab/excel?maxAge=1", content=response)
             single_view = TSC.ViewItem()
             single_view._id = "d79634e1-6063-4ec9-95ff-50acbf609ff5"
-            request_option = TSC.CSVRequestOptions(maxage=1)
+            request_option = TSC.ExcelRequestOptions(maxage=1)
             self.server.views.populate_excel(single_view, request_option)
 
             excel_file = b"".join(single_view.excel)