diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..d732afc --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,32 @@ +name: Publish to PyPi + +on: + workflow_dispatch: + push: + branches: development, main + +jobs: + build-n-publish: + name: Build dist files for PyPi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: 3.13 + - name: Build dist files + run: > + python -m pip install --upgrade pip && pip install -e .[build] && + python setup.py build && + python setup.py sdist --formats=gztar + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ec37d0e..c99b1e0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -6,54 +6,50 @@ name: Python package on: push: paths-ignore: - - 'docs/**' + - "docs/**" pull_request: - branches: '*' + branches: "*" jobs: build: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Test - run: | - python setup.py test - - + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test + run: | + python -m unittest discover -v + lint: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: [3.9] + python-version: [3.13] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pycodestyle - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with pycodestyle - run: | - pycodestyle tableaudocumentapi test samples - + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pycodestyle + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with pycodestyle + run: | + pycodestyle tableaudocumentapi test samples diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b3b4d43..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: python -cache: pip - -python: - - - "3.6" # EOL 23 Dec 2021 - - "3.7" - - "3.8" - - "3.9" - - "pypy3" # pypy = python 2 -# command to install dependencies -install: - - "pip install -e ." - - "pip install pycodestyle" -# command to run tests -script: - # Tests - - python setup.py test - # pycodestyle - - pycodestyle tableaudocumentapi test samples - # Examples - - (cd "samples/replicate-workbook" && python replicate_workbook.py) - - (cd "samples/list-tds-info" && python list_tds_info.py) - - (cd "samples/show-fields" && python show_fields.py) - diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0e38c..1a18c16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ -## 09 (December 2021) -* Pypi upgraded to Python3 +## 011 (November 2022) +* Remove extraneous debug print statements -## 08 (October 2021) -* See dashboards in a workbook -* Add shapes property -* Add custom sql -* Drop python 2, add up through 3.9 +## 010 (June 2022) +* Add service/schema attributes + +## 091 (March 2022) +* Add attribute for hidden field +## 09 (December 2021) +* PyPI upgraded to Python3 ## 08 (October 2021) * See dashboards in a workbook @@ -14,7 +16,6 @@ * Add custom sql * Drop python 2, add up through 3.9 - ## 07 (26 May 2021) * Fix bug in xfile that overwrote the namespace name when saving a document diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..10fb2b9 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +#ECCN:Open Source +#GUSINFO:Open Source,Open Source Workflow diff --git a/README b/README deleted file mode 120000 index 42061c0..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file diff --git a/README.md b/README.md index c142b13..beb0263 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,14 @@ # document-api-python -[![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) +[![As-Is](https://img.shields.io/badge/Support%20Level-As--Is-e8762c.svg)](https://www.tableau.com/support-levels-it-and-developer-tools) -This repo contains Python source and example files for the Tableau Document API. - -For more information, see the documentation: - - Document API --------------- -The Document API provides a supported way to programmatically make updates to Tableau workbook and data source files. If you've been making changes to these file types by directly updating the XML--that is, by XML hacking--this SDK is for you :) +This repo contains Python source and example files for the Tableau Document API. +The Document API provides a useful but *unsupported* way to programmatically make updates to Tableau workbook and data source files. If you've been making changes to these file types by directly updating the XML--that is, by XML hacking--this SDK is for you :) Get help from other users on the [Tableau Community Forums](https://community.tableau.com/s/topic/0TO4T000000SF3sWAG/document-api). Features include: -- Support for 9.X, 10.X and 202x.x workbook and data source files - - Including TDSX and TWBX files +- Support for TWB, TWBX, TDE and TDSX files starting roughly back to Tableau 9.x - Getting connection information from data sources and workbooks - Server Name - Username @@ -28,6 +23,9 @@ Features include: - Get all fields in a data source - Get all fields in use by certain sheets in a workbook -We don't yet support creating files from scratch, adding extracts into workbooks or data sources, or updating field information +- It *doesn't* support creating files from scratch, adding extracts into workbooks or data sources, or updating field information. As of 2021, this SDK no longer supports Python 2. + +For Hyper files, take a look at the [Tableau Hyper API](https://help.tableau.com/current/api/hyper_api/en-us/index.html). + +For more information, see the [Document API documentation](https://tableau.github.io/document-api-python) -As of 2021, this SDK no longer supports Python 2. diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 6bfb1db..1b50f51 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -1,9 +1,19 @@ + + + \ No newline at end of file diff --git a/docs/_includes/head.html b/docs/_includes/head.html index 47d9f92..858a412 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -11,6 +11,14 @@ + + + + + + diff --git a/docs/_includes/header.html b/docs/_includes/header.html index cad2487..6e8e763 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -15,7 +15,7 @@