@@ -38,10 +38,43 @@ Saves any changes to the workbook to a new file specified by the `new_file` para
38
38
39
39
` self.filename: ` Returns the filename of the workbook.
40
40
41
+ ` self.shapes ` Returns a list of strings with the names of shapes found in the workbook.
42
+
41
43
## Datasources
42
44
``` python
43
45
class Datasource (dsxml , filename = None )
44
46
```
47
+ A class representing Tableau Data Sources , embedded in workbook files or in TDS files .
48
+
49
+ **Params :**
50
+
51
+ ** Raises:**
52
+
53
+ ** Methods:**
54
+
55
+ `Datasource.save(self )` Saves any changes to the datasource to the existing file .
56
+
57
+ `Datasource.save_as(self )` Saves any changes to the datasource to a new file specified by the `new_file` parameter.
58
+
59
+ `Datasource.add_field(self , name, datatype, role, field_type, caption)` Adds a base field object with the given values.
60
+
61
+ `Datasource.remove_field(self , field)` Remove a given field.
62
+
63
+ `Datasource.add_calculation(self , caption, formula, datatype, role, type )` Adds a calculated field with the given values.
64
+
65
+ ** Properities:**
66
+
67
+ `self .name` Returns string with the name of datasource.
68
+
69
+ `self .version` Returns string of daatasource' s version.
70
+
71
+ `self .caption` Returns string of user defined name of datasource if exists.
72
+
73
+ `self .connections` Returns list of connections are used in workbook.
74
+
75
+ `self .fileds` Returns key- value result of field name and their attributes.
76
+
77
+ `self .calculations` Returns calculated field of the workbook.
45
78
46
79
# # Connections
47
80
```python
@@ -74,5 +107,49 @@ The Connection class represents a tableau data connection. It can be from any ty
74
107
75
108
# # Fields
76
109
```python
77
- class Workbook (column_xml = None , metadata_xml = None )
110
+ class Field (column_xml = None , metadata_xml = None )
78
111
```
112
+
113
+ Represents a field in a datasource
114
+
115
+ **Raises :**
116
+
117
+ ** Methods:**
118
+
119
+ `Field.create_field_xml()` Create field from scratch.
120
+
121
+ `Field.add_alias(self , key, value)` Add an alias for a given display value.
122
+
123
+ ** Properities:**
124
+
125
+ `self .name` Returns a string providing a nice name for the field which is derived from the alias, caption, or the id .
126
+
127
+ `self .id` Returns a string with name of the field as specified in the file , usually surrounded by [ ].
128
+
129
+ `self .xml` Returns a ElementTree object which represents an XML of the field.
130
+
131
+ `self .caption` Returns a string with the name of the field as displayed in Tableau unless an aliases is defined.
132
+
133
+ `self .alias` Returns a string with the name of the field as displayed in Tableau if the default name isn' t wanted.
134
+
135
+ `self .datatype` Returns a string with the type of the field within Tableau (string, integer, etc).
136
+
137
+ `self .role` Returns a string which identify field as a Dimension or Measure.
138
+
139
+ `self .type` Returns a string with type of field (quantitative, ordinal, nominal).
140
+
141
+ `self .aliases` Returns Key- value mappings of all aliases that are registered under this field.
142
+
143
+ `self .is_quantitative` Returns a boolean if field is quantitative.
144
+
145
+ `self .is_ordinal` Returns a boolean if field is categorical that has a specific order.
146
+
147
+ `self .is_nominal` Returns a boolean if field is categorical that does not have a specific order.
148
+
149
+ `self .calculation` Returns a string with the formula if this field is a calculated field.
150
+
151
+ `self .default_aggregation` Returns a string with he default type of aggregation on the field (e.g Sum, Avg).
152
+
153
+ `self .description` Returns a string with contents of the < desc> tag on a field.
154
+
155
+ `self .worksheets` Returns a list of strings with the worksheet' s names uses this field.
0 commit comments