diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..f5d5961 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,61 @@ +# Build and deploy the docs/ site to GitHub Pages using the repo's own +# Jekyll 4 Gemfile, so the published site matches a local `jekyll serve`. +# (GitHub's default Pages build uses the github-pages gem / Jekyll 3.9.) +name: Deploy docs to Pages + +on: + push: + branches: [master] + paths: + - "docs/**" + - ".github/workflows/pages.yml" + workflow_dispatch: + +# Allow GITHUB_TOKEN to deploy to Pages. +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment; don't cancel an in-progress run. +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: docs + steps: + - uses: actions/checkout@v7 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + bundler-cache: true + working-directory: docs + - name: Configure Pages + id: pages + uses: actions/configure-pages@v6 + - name: Build site + env: + JEKYLL_ENV: production + PAGES_BASE_PATH: ${{ steps.pages.outputs.base_path }} + run: bundle exec jekyll build --baseurl "$PAGES_BASE_PATH" + - name: Upload artifact + uses: actions/upload-pages-artifact@v5 + with: + path: docs/_site + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..ae9f81b --- /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@v7 + with: + fetch-depth: 0 + - uses: actions/setup-python@v6 + with: + python-version: 3.14 + - 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..47ba610 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,55 @@ +# 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.10", "3.11", "3.12", "3.13", "3.14"] + + steps: + - uses: actions/checkout@v7 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + 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.14] + + steps: + - uses: actions/checkout@v7 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + 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 deleted file mode 100644 index 3c5976a..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,38 +0,0 @@ -## 06 (11 January 2017) - -* Initial SQL and query banding support (#123) -* Fixed bug in xfiles to allow opening workbooks with external file caches (#117, #118) -* Code Cleanup (#120, #121) -* Added Py36 support (#124) -* Switched to pycodestyle from pip8 on travis runs (#124) - -## 05 (01 November 2016) - -* Added ability to set the port for connections (#97) -* Added ability to read and write caption for datasources (#99) -* Added documentation - -## 0.4 (07 October 2016) - -* Add ability to remove repository location (#86) -* Fixed bug in connection parsing when federated connections are present (#87) -* Fixed bug in UNICODE support (#80) - -## 0.3 (31 August 2016) - -* Added basic connection class retargeting (#65) -* Added ability to create a new connection (#69) -* Added description to the field object (#73) -* Improved Test Coverage (#62, #67) - -## 0.2 (22 July 2016) - -* Added support for loading twbx and tdsx files (#43, #44) -* Added Fields property to datasource (#45) -* Added Example for using the Fields Property (#51) -* Added Ability to get fields used by a specific sheet (#54) -* Code clean up and test reorganization - -## 0.1 (29 June 2016) - -* Initial Release to the world 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/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index 903e57b..0000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,15 +0,0 @@ -This project wouldn't be possible without our amazing contributors. - -The following people have contributed to this project to make it possible, and we thank them for their contributions! - -## Contributors - -* [Charley Peng](https://github.com/chid) -* [Miguel Sánchez](https://github.com/MiguelSR) -* [Ryan Richmond](https://github.com/r-richmond) - -## Core Team - -* [Tyler Doyle](https://github.com/t8y8) -* [Russell Hay](https://github.com/RussTheAerialist) - 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/contributing.md b/contributing.md deleted file mode 120000 index e047e03..0000000 --- a/contributing.md +++ /dev/null @@ -1 +0,0 @@ -docs/docs/contributing.md \ No newline at end of file diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..fd1ef36 --- /dev/null +++ b/contributing.md @@ -0,0 +1,3 @@ +# Contributing + +See the [Contributing guide](https://tableau.github.io/document-api-python/docs/contributing) in the project documentation. diff --git a/docs/Gemfile b/docs/Gemfile index 775d954..83a0e1a 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,3 +1,9 @@ source 'https://rubygems.org' -gem 'github-pages', group: :jekyll_plugins +# Standalone Jekyll 4 runs on modern Ruby (4.0+). We don't use the +# github-pages gem because it pins an old Jekyll/Liquid that is +# incompatible with Ruby 3.2+ (String#untaint was removed). +gem 'jekyll', '~> 4.3' + +# webrick was removed from Ruby's default gems in 3.0; needed by `jekyll serve`. +gem 'webrick' 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 %}