diff --git a/docs/docs/api-ref.md b/docs/docs/api-ref.md index cf6bc96..6b150fd 100644 --- a/docs/docs/api-ref.md +++ b/docs/docs/api-ref.md @@ -38,10 +38,39 @@ Saves any changes to the workbook to a new file specified by the `new_file` para `self.filename:` Returns the filename of the workbook. +`self.shapes` Returns a list of strings with the names of shapes found in the workbook. + ## Datasources ```python class Datasource(dsxml, filename=None) ``` +A class representing Tableau Data Sources, embedded in workbook files or in TDS files. + +**Params:** + +**Raises:** + +**Methods:** + +save + +save_as + +add_calculation + +**Properities:** + +`self.name` Returns string with the name of datasource. + +`self.version` Returns string of daatasource's version. + +`self.caption` Returns string of user defined name of datasource if exists. + +`self.connections` Returns list of connections are used in workbook. + +`self.fileds` Returns key-value result of field name and their attributes. + +`self.calculations` Returns calculated field of the workbook. ## Connections ```python @@ -74,5 +103,48 @@ The Connection class represents a tableau data connection. It can be from any ty ## Fields ```python -class Workbook(column_xml=None, metadata_xml=None) +class Field(column_xml=None, metadata_xml=None) ``` + +Represents a field in a datasource + +**Raises:** + +**Methods:** +`Field.create_field_xml()` Create field from scratch. + +`Field.add_alias(self, key, value)` Add an alias for a given display value. + +**Properities:** + +`self.name` Returns a string providing a nice name for the field which is derived from the alias, caption, or the id. + +`self.id` Returns a string with name of the field as specified in the file, usually surrounded by [ ]. + +`self.xml` Returns a ElementTree object which represents an XML of the field. + +`self.caption` Returns a string with the name of the field as displayed in Tableau unless an aliases is defined. + +`self.alias` Returns a string with the name of the field as displayed in Tableau if the default name isn't wanted. + +`self.datatype` Returns a string with the type of the field within Tableau (string, integer, etc). + +`self.role` Returns a string which identify field as a Dimension or Measure. + +`self.type` Returns a string with type of field (quantitative, ordinal, nominal). + +`self.aliases` Returns Key-value mappings of all aliases that are registered under this field. + +`self.is_quantitative` Returns a boolean if field is quantitative. + +`self.is_ordinal` Returns a boolean if field is categorical that has a specific order. + +`self.is_nominal` Returns a boolean if field is categorical that does not have a specific order. + +`self.calculation` Returns a string with the formula if this field is a calculated field. + +`self.default_aggregation` Returns a string with he default type of aggregation on the field (e.g Sum, Avg). + +`self.description` Returns a string with contents of the tag on a field. + +`self.worksheets` Returns a list of strings with the worksheet's names uses this field. diff --git a/tableaudocumentapi/datasource.py b/tableaudocumentapi/datasource.py index f108f6d..ccf6c91 100644 --- a/tableaudocumentapi/datasource.py +++ b/tableaudocumentapi/datasource.py @@ -184,14 +184,17 @@ def save_as(self, new_filename): @property def name(self): + """ Name of the datasource. """ return self._name @property def version(self): + """ Version of the datasource. """ return self._version @property def caption(self): + """ User defined name for the datasourse. """ return self._caption @caption.setter @@ -206,6 +209,7 @@ def caption(self): @property def connections(self): + """ List of connections are used in workbook. """ return self._connections def clear_repository_location(self): @@ -215,6 +219,7 @@ def clear_repository_location(self): @property def fields(self): + """ Key-value result of field's names and its attributes. Dict. """ if not self._fields: self._refresh_fields() return self._fields diff --git a/tableaudocumentapi/field.py b/tableaudocumentapi/field.py index 88d5b3b..ec35719 100644 --- a/tableaudocumentapi/field.py +++ b/tableaudocumentapi/field.py @@ -215,7 +215,7 @@ def role(self, role): @property def type(self): - """ Dimension or Measure """ + """ Type of field (quantitative, ordinal, nominal) """ return self._type @type.setter @@ -336,6 +336,7 @@ def description(self): @property def worksheets(self): + """ Worksheets which uses field. """ return list(self._worksheets) ###################################### pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy