Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 5 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Publish to PyPi


on:
workflow_dispatch:
push:
Expand All @@ -11,24 +10,23 @@ jobs:
name: Build dist files for PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v1
- uses: actions/setup-python@v6
with:
python-version: 3.8
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
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
uses: pypa/gh-action-pypi-publish@release/v1 # license BSD-2
with:
password: ${{ secrets.PYPI_API_TOKEN }}

64 changes: 30 additions & 34 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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, '3.10']
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

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@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.9]
python-version: [3.14]

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@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
57 changes: 0 additions & 57 deletions CHANGELOG.md

This file was deleted.

2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#ECCN:Open Source
#GUSINFO:Open Source,Open Source Workflow
15 changes: 0 additions & 15 deletions CONTRIBUTORS.md

This file was deleted.

15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# 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)
[![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:

<https://tableau.github.io/document-api-python>

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 TWB, TWBX, TDE and TDSX files starting roughly back to Tableau 9.x
Expand All @@ -27,8 +23,9 @@ Features include:
- Get all fields in a data source
- Get all fields in use by certain sheets in a workbook

- 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).

We don't support creating files from scratch, adding extracts into workbooks or data sources, or updating field information
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.
1 change: 0 additions & 1 deletion contributing.md

This file was deleted.

3 changes: 3 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing

See the [Contributing guide](https://tableau.github.io/document-api-python/docs/contributing) in the project documentation.
8 changes: 7 additions & 1 deletion docs/Gemfile
Original file line number Diff line number Diff line change
@@ -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'
24 changes: 17 additions & 7 deletions docs/_includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
<!-- Footer -->
<footer>
<div class="row">
<hr class="footer-hr">
<p>This site is open source. Suggestions and pull requests are welcome on our <a href="https://github.com/tableau/document-api-python">GitHub page</a>.</p>
<p><a href="https://www.tableau.com/en-us/legal" class="aLegal">LEGAL</a> <a href="https://www.tableau.com/en-us/privacy" class="aLegal">PRIVACY</a> &copy; 2003&ndash;<script>document.write(new Date().getFullYear())</script> TABLEAU SOFTWARE LLC. ALL RIGHTS RESERVED</p>
<sub>Documentation last generated on: {{ site.time }}</sub>
</div>
</footer>
<hr class="footer-hr">
<nav aria-label="Footer Navigation">
<ul class="footer-links">
<li><a href="https://www.salesforce.com/company/legal/">Legal</a></li>
<li><a href="https://www.salesforce.com/company/legal/sfdc-website-terms-of-service/">Terms of Service</a></li>
<li><a href="https://www.salesforce.com/company/privacy/">Privacy Information</a></li>
<li><a href="https://www.salesforce.com/company/legal/disclosure/">Responsible Disclosure</a></li>
<li><a href="https://trust.salesforce.com/">Trust</a></li>
<li><a href="#" data-ignore-geolocation="true" class="optanon-toggle-display">Cookie Preferences</a></li>
<li><a href="https://www.salesforce.com/form/other/privacy-request/">Your Privacy Choices</a></li>
</ul>
<p class="copyRight">This site is open source. Suggestions and pull requests are welcome on our <a href="https://github.com/tableau/document-api-python">GitHub page</a>.</p>
<p class="copyRight">&copy; Copyright <script>document.write(new Date().getFullYear())</script> Salesforce, Inc. <a href="https://www.salesforce.com/company/legal/tmcusageguidelines/">All rights reserved.</a> Various trademarks held by their respective owners.
Salesforce, Inc. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States</p>
<sub>Documentation last generated on: {{ site.time }}</sub></p>
</nav>
</footer>
8 changes: 8 additions & 0 deletions docs/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/github-highlight.css">

<!-- OneTrust Cookies Consent Notice start for tableau.github.io -->
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="019321c1-4b7e-7313-9372-ddbd938f50ea" ></script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>
<!-- OneTrust Cookies Consent Notice end for tableau.github.io -->


<script src="{{ site.baseurl }}/js/redirect-to-search.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
Expand Down
37 changes: 37 additions & 0 deletions docs/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,40 @@ html {
word-spacing: 8px;
padding-right: 8px;
}

.copyRight {
font-size: 12px;
}

.footer-links {
display: flex;
justify-content: center;
list-style: none;
padding: 0;
flex-wrap: wrap;
}

.footer-links li {
margin: 0 15px;
}

.footer-links a {
text-decoration: none;
transition: color 0.3s;
font-size: 12px;
}

.footer-links a:hover {
text-decoration: underline;
}

/* One Trust Cookie Manager
-------------------- */
#ot-pc-content, .ot-title-cntr, .ot-pc-footer {
font-size: 1.6rem;
}

#ot-pc-footer {
font-size: 1.4rem;
}

Loading