8000 #141 Enable Zip64 Extensions To Support Zipfile >= 2GB by doulam · Pull Request #143 · tableau/document-api-python · GitHub
[go: up one dir, main page]

Skip to content

#141 Enable Zip64 Extension 8000 s To Support Zipfile >= 2GB #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,11 @@ target/
.DS_Store
.idea

#Editor things
*.sublime-project
*.sublime-workspace
settings.json
tasks.json

#Jekyll
docs/_site
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ python:
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "pypy"
# command to install dependencies
install:
- "pip install -e ."
- "pip install pep8"
- "pip install pycodestyle"
# command to run tests
script:
# Tests
- python setup.py test
# pep8
- pep8 .
# pycodestyle
- pycodestyle tableaudocumentapi test samples
# Examples
- (cd "samples/replicate-workbook" && python replicate_workbook.py)
- (cd "samples/list-tds-info" && python list_tds_info.py)
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 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)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The following people have contributed to this project to make it possible, and w

* [Charley Peng](https://github.com/chid)
* [Miguel Sánchez](https://github.com/MiguelSR)
* [Ryan Richmond](https://github.com/r-richmond)

## Core Team

Expand Down
85 changes: 4 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

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:

<http://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 :)
Expand All @@ -26,84 +30,3 @@ Features include:
- 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


###Getting Started
To use this SDK, you must have Python installed. You can use either 2.7.X or 3.3 and later.

#### Installing the latest stable version (preferred)

```text
pip install tableaudocumentapi
```

#### Installing From Source

Download the `.zip` file that contains the SDK. Unzip the file and then run the following command:

```text
pip install -e <directory containing setup.py>
```

#### Installing the Development Version from Git

*Only do this if you know you want the development version, no guarantee that we won't break APIs during development*

```text
pip install git+https://github.com/tableau/document-api-python.git@development
```

If you go this route, but want to switch back to the non-development version, you need to run the following command before installing the stable version:

```text
pip uninstall tableaudocumentapi
```

###Basics
The following example shows the basic syntax for using the Document API to update a workbook:

```python
from tableaudocumentapi import Workbook

sourceWB = Workbook('WorkbookToUpdate.twb')

sourceWB.datasources[0].connections[0].server = "MY-NEW-SERVER"
sourceWB.datasources[0].connections[0].dbname = "NEW-DATABASE"
sourceWB.datasources[0].connections[0].username = "benl"

sourceWB.save()
```

With Data Integration in Tableau 10, a data source can have multiple connections. To access the connections simply index them like you would datasources.

```python
from tableaudocumentapi import Workbook

sourceWB = Workbook('WorkbookToUpdate.twb')

sourceWB.datasources[0].connections[0].server = "MY-NEW-SERVER"
sourceWB.datasources[0].connections[0].dbname = "NEW-DATABASE"
sourceWB.datasources[0].connections[0].username = "benl"

sourceWB.datasources[0].connections[1].server = "MY-NEW-SERVER"
sourceWB.datasources[0].connections[1].dbname = "NEW-DATABASE"
sourceWB.datasources[0].connections[1].username = "benl"


sourceWB.save()
```


**Notes**

- Import the `Workbook` object from the `tableaudocumentapi` module.
- To open a workbook, instantiate a `Workbook` object and pass the file name as the first argument.
- The `Workbook` object exposes a list of `datasources` in the workbook
- Each data source object has a `connection` object that supports a `server`, `dbname`, and `username` property.
- Save changes to the workbook by calling the `save` or `save_as` method.



###[Examples](samples)

The downloadable package contains several example scripts that show more detailed usage of the Document API.
7 changes: 7 additions & 0 deletions docs/_includes/analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-BVCN');</script>
<!-- End Google Tag Manager -->
4 changes: 3 additions & 1 deletion docs/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
<link rel="stylesheet" href="{{ site.baseurl }}/css/github-highlight.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

{% if jekyll.environment == "production" %}{% include analytics.html %}{% endif %}
24 changes: 24 additions & 0 deletions docs/docs/api-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ class Datasource(dsxml, filename=None)
class Connection(connxml)
```

The Connection class represents a tableau data connection. It can be from any type of connection found in `dbclass.py` via `is_valid_dbclass`

**Params:**

**Raises:**

**Methods:**

**Properities:**

`self.server:` Returns a string containing the server.

`self.dbname:` Returns a string containing the database name.

`self.username:` Returns a string containing the username.

`self.dbclass:` Returns a string containing the database class.

`self.port:` Returns a string containing the port.

`self.query_band:` Returns a string containing the query band.

`self.initial_sql:` Returns a string containing the initial sql.

## Fields
```python
class Workbook(column_xml=None, metadata_xml=None)
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/dev-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: Developer Guide
layout: docs
---

<<<<<<< 6ee666bf06d5ab59931100b3955779c35693e33f
## Submitting your first patch

1. Make sure you have [signed the CLA](http://tableau.github.io/#contributor-license-agreement-cla)
Expand Down Expand Up @@ -53,7 +52,7 @@ layout: docs
Our documentation is written in markdown and built with Jekyll on Github Pages. All of the documentation source files can be found in `docs/docs`.

When adding a new feature or improving existing functionality we may ask that you update the documentation along with your code.

If you are just making a PR for documentation updates (adding new docs, fixing typos, improving wording) the easiest method is to use the built in `Edit this file` in the Github UI

1. Submit to your fork.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='tableaudocumentapi',
version='0.5',
version='0.6',
author='Tableau',
author_email='github@tableau.com',
url='https://github.com/tableau/document-api-python',
Expand Down
Loading
0