Skip to content

Commit 753bd96

Browse files
authored
hidden fields, schema and service fields (#231)
1 parent 600ca48 commit 753bd96

File tree

14 files changed

+1115
-76
lines changed

14 files changed

+1115
-76
lines changed

.github/workflows/publish-pypi.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish to PyPi
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.9]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install wheel
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
- name: Package
27+
run: |
28+
python setup.py sdist
29+
python setup.py bdist_wheel
30+
31+
32+
test-deploy:
33+
if: github.ref_type == 'tag' && contains(github.ref_name, 'test')
34+
needs: build
35+
environment:
36+
name: test-pypi
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Publish 📦 to Test PyPI
40+
uses: pypa/gh-action-pypi-publish@master
41+
with:
42+
password: ${{ secrets.TEST_PYPI_TOKEN }}
43+
repository_url: https://test.pypi.org/legacy/
44+
45+
46+
production-deploy:
47+
needs: build
48+
environment:
49+
name: pypi
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Publish 📦 to Real PyPI
53+
uses: pypa/gh-action-pypi-publish@master
54+
with:
55+
password: ${{ secrets.PYPI_API_TOKEN }}
56+
repository_url: https://pypi.org/legacy/

.github/workflows/python-package.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: [3.7, 3.8, 3.9]
20+
python-version: [3.7, 3.8, 3.9, 3.10]
2121

2222
steps:
2323
- uses: actions/checkout@v2

CHANGELOG.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
## 09 (December 2021)
2-
* Pypi upgraded to Python3
31

4-
## 08 (October 2021)
5-
* See dashboards in a workbook
6-
* Add shapes property
7-
* Add custom sql
8-
* Drop python 2, add up through 3.9
2+
## 091 (March 2022)
3+
* Add attribute for hidden field
94

5+
## 09 (December 2021)
6+
* Pypi upgraded to Python3
107

118
## 08 (October 2021)
129
* See dashboards in a workbook
1310
* Add shapes property
1411
* Add custom sql
1512
* Drop python 2, add up through 3.9
1613

17-
1814
## 07 (26 May 2021)
1915
* Fix bug in xfile that overwrote the namespace name when saving a document
2016

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# document-api-python
2-
[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools) [![Build Status](https://travis-ci.org/tableau/document-api-python.svg?branch=master)](https://travis-ci.org/tableau/document-api-python)
2+
[![Tableau Supported](https://img.shields.io/badge/Support%20Level-Tableau%20Supported-53bd92.svg)](https://www.tableau.com/support-levels-it-and-developer-tools)
33

44
This repo contains Python source and example files for the Tableau Document API.
55

@@ -29,6 +29,6 @@ Features include:
2929

3030
For Hyper files, take a look a the [Tableau Hyper API](https://help.tableau.com/current/api/hyper_api/en-us/index.html).
3131

32-
We don't yet support creating files from scratch, adding extracts into workbooks or data sources, or updating field information
32+
We don't support creating files from scratch, adding extracts into workbooks or data sources, or updating field information
3333

3434
As of 2021, this SDK no longer supports Python 2.

docs/docs/api-ref.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,27 @@ A class representing Tableau Data Sources, embedded in workbook files or in TDS
5252

5353
**Methods:**
5454

55-
save
55+
`Datasource.save(self)` Saves any changes to the datasource to the existing file.
5656

57-
save_as
57+
`Datasource.save_as(self)` Saves any changes to the datasource to a new file specified by the `new_file` parameter.
5858

59-
add_calculation
59+
`Datasource.add_field(self, name, datatype, role, field_type, caption)` Adds a base field object with the given values.
6060

61-
**Properities:**
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+
**Properties:**
6266

6367
`self.name` Returns string with the name of datasource.
6468

6569
`self.version` Returns string of daatasource's version.
6670

6771
`self.caption` Returns string of user defined name of datasource if exists.
6872

69-
`self.connections` Returns list of connections are used in workbook.
73+
`self.connections` Returns list of connections used in workbook.
7074

71-
`self.fileds` Returns key-value result of field name and their attributes.
75+
`self.fields` Returns key-value result of field name and their attributes.
7276

7377
`self.calculations` Returns calculated field of the workbook.
7478

@@ -115,7 +119,7 @@ Represents a field in a datasource
115119

116120
`Field.add_alias(self, key, value)` Add an alias for a given display value.
117121

118-
**Properities:**
122+
**Properties:**
119123

120124
`self.name` Returns a string providing a nice name for the field which is derived from the alias, caption, or the id.
121125

publish.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
2+
pip install wheel
33
set -e
44

55
rm -rf dist

python-package.yml

-38
This file was deleted.

0 commit comments

Comments
 (0)