Giter VIP home page Giter VIP logo

tableau_api's Introduction

tableau_api

Build Status Gem Version

Ruby interface to the Tableau 9.0 API.

Installation

Add this line to your application's Gemfile:

gem 'tableau_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tableau_api

Usage

Basic Authentication

client = TableauApi.new(host: 'https://tableau.domain.tld', site_name: 'Default', username: 'ExampleUsername', password: 'ExamplePassword')
client.users.create(username: 'baz')

Trusted Authentication

client = TableauApi.new(host: 'https://tableau.domain.tld', site_name: 'Default', username: 'ExampleUsername')
client.auth.trusted_ticket

Workbooks

# find a workbook by name
workbook = client.workbooks.list.find do |w|
  w['name'] == 'Example Workbook Name'
end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake to run the tests and linters. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Testing

Docker

docker run -it -d -v $(pwd):/src ruby:2 /bin/bash
docker exec -it CONTAINER_ID /bin/bash -c "cd /src && bundle && rake"

Creating New VCR Cassettes

Cassettes should be self-contained, generated by a single spec file run in defined order. To make changes to specs, it's best to delete a whole cassette and rerun the whole spec file, except for auth.yml, since it could be difficult to generate a trusted ticket from a non-trusted host.

To regenerate all the the cassettes, you'll first need to create the following on the Tableau server:

  • Site: Default
  • Site: TestSite
  • Datasource: test (this might need to be created from Tableau Desktop)
  • Username: test_test

And delete the following if they exist:

  • Group: testgroup (probably under TestSite)
  • Project: test_project (probably under Default)
  • Site: Test Site 2
  • User: test (probably under TestSite)
  • Workbook: test
  • Workbook: testpublish

Set the environment variables below to an administrator account and your Tableau Server hostname.

Then run the commands below:

docker run -it -d \
  -v $(pwd):/src \
  -e TABLEAU_HOST -e TABLEAU_ADMIN_USERNAME -e TABLEAU_ADMIN_PASSWORD \
  ruby /bin/bash
docker exec -it CONTAINER_ID /bin/bash -c "cd /src && bundle && rake"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/civisanalytics/tableau_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

tableau_api is released under the BSD 3-Clause License.

tableau_api's People

Contributors

anja-schulz avatar aripollak avatar christophermanning avatar jeffreyc avatar jonknapp avatar mattyb avatar rubonz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.