Skip to content

Commit

Permalink
chore: remove examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jorwoods committed Oct 16, 2024
1 parent a249422 commit ee00b07
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 85 deletions.
18 changes: 0 additions & 18 deletions tableauserverclient/server/pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,6 @@ class Pager(Iterable[T]):
------
ValueError
If the endpoint is not a callable or an Endpoint object.
Examples
--------
>>> # Loop over all workbooks on the site
>>> for workbook in TSC.Pager(server.workbooks):
>>> print(workbook.name)
>>> # Setting page size
>>> request_options = TSC.RequestOptions(pagesize=1000)
>>> all_workbooks = list(TSC.Pager(server.workbooks, request_options))
>>> # Starting on page 2
>>> request_options = TSC.RequestOptions(pagenumber=2)
>>> for workbook in TSC.Pager(server.workbooks, request_options):
>>> print(workbook.name)
>>> # Using in a list comprehension
>>> views = [view for view in TSC.Pager(workbook.views) if "sales" in view.name.lower()]
"""

def __init__(
Expand Down
53 changes: 0 additions & 53 deletions tableauserverclient/server/request_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ class contained within this class.
pagesize: int, optional
The number of items to return per page. Default is 100. Can also read
from the environment variable `TSC_PAGE_SIZE`
Examples
--------
>>> # Get the first 50 workbooks on the site
>>> request_options = TSC.RequestOptions(pagesize=50)
>>> # Get the next 50 workbooks on the site
>>> request_options.page_number(2)
>>> # Get the first 50 workbooks on the site, sorted by name
>>> request_options = TSC.RequestOptions(pagesize=50)
>>> request_options.sort.add(TSC.Sort(TSC.RequestOptions.Field.Name, TSC.Sort.Direction.Asc))
>>> # Get the first 50 workbooks on the site, filtered by a tag
>>> request_options = TSC.RequestOptions(pagesize=50)
>>> request_options.filter.add(TSC.Filter(TSC.RequestOptions.Field.Tags, TSC.Filter.Operator.Equals, "important"))
"""

def __init__(self, pagenumber=1, pagesize=None):
Expand Down Expand Up @@ -293,15 +276,6 @@ class CSVRequestOptions(_DataExportOptions):
maxage: int, optional
The maximum age of the data to export. Shortest possible duration is 1
minute. No upper limit. Default is -1, which means no limit.
Examples
--------
>>> # Export the view to CSV
>>> request_options = TSC.CSVRequestOptions()
>>> request_options.vf("Region", "West")
>>> server.views.populate_csv(view_item, request_options)
>>> with open("output.csv", "wb") as f:
>>> for chunk in view_item.csv():
"""

extension = "csv"
Expand All @@ -318,15 +292,6 @@ class ExcelRequestOptions(_DataExportOptions):
maxage: int, optional
The maximum age of the data to export. Shortest possible duration is 1
minute. No upper limit. Default is -1, which means no limit.
Examples
--------
>>> # Export the view to CSV
>>> request_options = TSC.CSVRequestOptions()
>>> request_options.vf("Region", "West")
>>> server.views.populate_csv(view_item, request_options)
>>> with open("output.csv", "wb") as f:
>>> for chunk in view_item.csv():
"""

extension = "xlsx"
Expand All @@ -349,15 +314,6 @@ class ImageRequestOptions(_DataExportOptions):
maxage: int, optional
The maximum age of the data to export. Shortest possible duration is 1
minute. No upper limit. Default is -1, which means no limit.
Examples
--------
>>> # Export the view to an image
>>> request_options = TSC.ImageRequestOptions()
>>> request_options.vf("Region", "West")
>>> server.views.populate_image(view_item, request_options)
>>> with open("output.png", "wb") as f:
>>> f.write(view_item.image)
"""

extension = "png"
Expand Down Expand Up @@ -400,15 +356,6 @@ class PDFRequestOptions(_DataExportOptions):
viz_width: int, optional
The width of the viz in pixels. If specified, viz_height must also be specified.
Examples
--------
>>> # Export the view to a pdf
>>> request_options = TSC.PDFRequestOptions()
>>> request_options.vf("Region", "West")
>>> server.views.populate_pdf(view_item, request_options)
>>> with open("output.pdf", "wb") as f:
>>> f.write(view_item.pdf)
"""

class PageType:
Expand Down
14 changes: 0 additions & 14 deletions tableauserverclient/server/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ class Sort:
direction : str
The direction to sort, either ascending (Asc) or descending (Desc). The
options are defined in the RequestOptions.Direction class.
Examples
--------
>>> # create a new instance of a request option object
>>> req_option = TSC.RequestOptions()
>>> # add the sort expression, sorting by name and direction
>>> req_option.sort.add(TSC.Sort(TSC.RequestOptions.Field.Name,
TSC.RequestOptions.Direction.Asc))
>>> matching_workbooks, pagination_item = server.workbooks.get(req_option)
>>> for wb in matching_workbooks:
>>> print(wb.name)
"""

def __init__(self, field, direction):
Expand Down

0 comments on commit ee00b07

Please sign in to comment.