diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..9c208c4 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,34 @@ +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@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v1 + with: + python-version: 3.8 + - 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 new file mode 100644 index 0000000..4bd171f --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,59 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + paths-ignore: + - 'docs/**' + pull_request: + branches: '*' + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, '3.10'] + + 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 + + + lint: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.9] + + 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 + diff --git a/.gitignore b/.gitignore index 581cedb..994e968 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,8 @@ var/ pip-log.txt pip-delete-this-directory.txt +Gemfile.lock + # Unit test / coverage reports htmlcov/ .tox/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 454322d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: python -cache: pip - -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "pypy" -# 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 3c5976a..1a18c16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +## 011 (November 2022) +* Remove extraneous debug print statements + +## 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 +* Add shapes property +* 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 + ## 06 (11 January 2017) * Initial SQL and query banding support (#123) 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 bffea0e..beb0263 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,14 @@ # 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) -[![Build Status](https://travis-ci.org/tableau/document-api-python.svg?branch=master)](https://travis-ci.org/tableau/document-api-python) - -This repo contains Python source and example files for the Tableau Document API. We're just getting started and have plans to expand what you find here. Help us by submitting feedback, issues, and pull requests! - -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, and 10.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 @@ -29,4 +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) + diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock deleted file mode 100644 index e555d12..0000000 --- a/docs/Gemfile.lock +++ /dev/null @@ -1,129 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.2.6) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.4.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - colorator (0.1) - ethon (0.9.0) - ffi (>= 1.3.0) - execjs (2.7.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - ffi (1.9.10) - ffi (1.9.10-x86-mingw32) - gemoji (2.1.0) - github-pages (80) - github-pages-health-check (= 1.1.0) - jekyll (= 3.1.6) - jekyll-coffeescript (= 1.0.1) - jekyll-feed (= 0.5.1) - jekyll-gist (= 1.4.0) - jekyll-github-metadata (= 1.11.1) - jekyll-mentions (= 1.1.2) - jekyll-paginate (= 1.1.0) - jekyll-redirect-from (= 0.10.0) - jekyll-sass-converter (= 1.3.0) - jekyll-seo-tag (= 1.4.0) - jekyll-sitemap (= 0.10.0) - jemoji (= 0.6.2) - kramdown (= 1.10.0) - liquid (= 3.0.6) - listen (= 3.0.6) - mercenary (~> 0.3) - rouge (= 1.10.1) - terminal-table (~> 1.4) - github-pages-health-check (1.1.0) - addressable (~> 2.3) - net-dns (~> 0.8) - octokit (~> 4.0) - public_suffix (~> 1.4) - typhoeus (~> 0.7) - html-pipeline (2.4.1) - activesupport (>= 2, < 5) - nokogiri (>= 1.4) - i18n (0.7.0) - jekyll (3.1.6) - colorator (~> 0.1) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) - mercenary (~> 0.3.3) - rouge (~> 1.7) - safe_yaml (~> 1.0) - jekyll-coffeescript (1.0.1) - coffee-script (~> 2.2) - jekyll-feed (0.5.1) - jekyll-gist (1.4.0) - octokit (~> 4.2) - jekyll-github-metadata (1.11.1) - octokit (~> 4.0) - jekyll-mentions (1.1.2) - html-pipeline (~> 2.3) - jekyll (~> 3.0) - jekyll-paginate (1.1.0) - jekyll-redirect-from (0.10.0) - jekyll (>= 2.0) - jekyll-sass-converter (1.3.0) - sass (~> 3.2) - jekyll-seo-tag (1.4.0) - jekyll (~> 3.0) - jekyll-sitemap (0.10.0) - jekyll-watch (1.4.0) - listen (~> 3.0, < 3.1) - jemoji (0.6.2) - gemoji (~> 2.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0) - json (1.8.3) - kramdown (1.10.0) - liquid (3.0.6) - listen (3.0.6) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) - mercenary (0.3.6) - mini_portile2 (2.0.0) - minitest (5.9.0) - multipart-post (2.0.0) - net-dns (0.8.0) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - nokogiri (1.6.7.2-x86-mingw32) - mini_portile2 (~> 2.0.0.rc2) - octokit (4.3.0) - sawyer (~> 0.7.0, >= 0.5.3) - public_suffix (1.5.3) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rouge (1.10.1) - safe_yaml (1.0.4) - sass (3.4.22) - sawyer (0.7.0) - addressable (>= 2.3.5, < 2.5) - faraday (~> 0.8, < 0.10) - terminal-table (1.5.2) - thread_safe (0.3.5) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - x86-mingw32 - -DEPENDENCIES - github-pages - -BUNDLED WITH - 1.12.5 diff --git a/docs/_includes/docs_menu.html b/docs/_includes/docs_menu.html index b7a76d5..eae8806 100644 --- a/docs/_includes/docs_menu.html +++ b/docs/_includes/docs_menu.html @@ -1,4 +1,5 @@
+ {% include search_form.html %}