Tableau REST API Resources

tableauandbehold.com is the blog home of the tableau_tools Python library, which is always available via:

PyPi

GitHub

tableau_tools includes the tableau_rest_api sub-package, which is a full implementation of all Tableau REST API capabilities and some other useful capabilities (such as programmatic data source changes and field name localization).

There are more “unofficial” implementations of the Tableau REST API in other languages (C#, Java, PHP) available at DataPainters.

Info on tableau_tools library

If you are getting started using the tableau_tools library, there is an examples directory.  I personally use PyCharm as an IDE for developing — the library was written using PyCharm and the autocomplete functions make it very quick to write useful scripts.

The README file is a full guide to the library and is essential reading when getting started.

Internationalization / Localization

Creating “localized” workbooks from a template

Info on the Tableau REST API

The Tableau REST API itself is completed documented on the Tableau Online Help. The following posts described how it works and what to take into consideration if implementing yourself. For topics that are implemented in the tableau_tools library, the posts in the section above may also include the relevant info on “why” as well as “how”.

https://tableauandbehold.com/2015/08/06/tableau-rest-api-400-error-response-code-400011/

 

Advertisements

4 comments

  1. I don’t believe that showing the view name is working correctly. Here is what I’m using to get it:
    tab_srv.signin()
    view_names = []
    workbook_luid = tab_srv.query_workbook_luid_for_username_by_workbook_name_in_project(username, workbookname, projectname)

    views = tab_srv.query_workbook_views_by_luid(workbook_luid)

    print views

    When this is run, it simply returns:

    I’m hoping I’m just doing something incorrectly

    Like

    1. Hi Steve,
      All of the query methods return lxml objects that represent all of the information returned by the API call (You can see what these look like in the Tableau REST API Reference manual) There is a method you can use to convert the lxml object into a name => luid pair like this: views_dict = tab_srv.convert_xml_list_to_name_id_dict(views)

      This should work in most cases, although it might break if you have views that are named the same thing

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s