Welcome to this month’s basic DataDevQuest challenge! This challenge is designed to sharpen your skills in interacting with Tableau Server or Tableau Online programmatically. Whether you’re a seasoned developer or just starting out, this task will help you get familiar with the basics of the Tableau REST API or the Tableau Server Client (TSC) library for Python.
Challenge Overview
Objective:
Write a program that takes input from the user to search and retrieve information about a Tableau view by its name. The program should connect to Tableau Server or Tableau Online, search for the view, and display relevant details in an organized format.
Why This Challenge?
Working with Tableau’s APIs allows you to automate tasks, integrate Tableau with other systems, and extend its functionality. This challenge will give you hands-on experience with authentication, making API calls, and handling responses—essential skills for any Tableau developer.
Challenge Details
Requirements
- User Input:
- Prompt the user to enter the name of a Tableau view they wish to find.
- Authentication:
- Python Users:
- Use the Tableau Server Client (TSC) library for authentication.
- Other Languages:
- Use the Tableau REST API directly for authentication.
- Handle authentication securely and efficiently.
- Python Users:
- View Search:
- Search for the view on Tableau Server or Tableau Online that matches the user’s input.
- The search should be case-insensitive.
- Display Information:
- If the view is found, display the following details:
- View Name
- View ID
- Workbook Name
- Project Name
- View URL
- If multiple views match, display details for each.
- If no views are found, inform the user accordingly.
- If the view is found, display the following details:
- Error Handling:
- Gracefully handle errors such as authentication failures, network issues, or API errors.
- Provide meaningful messages to help the user understand what went wrong.
Constraints
- Programming Language:
- You may use any programming language.
- Python users are encouraged to use the Tableau Server Client (TSC) library.
- Users of other languages should utilize the Tableau REST API directly.
- Permissions:
- Assume the user has the necessary permissions to access the views on Tableau Server or Tableau Online.
- Code Quality:
- Write clean, maintainable code.
- Include comments to explain complex sections.
Optional Enhancements
- Pagination Handling:
- If the number of results is large, implement pagination to handle them efficiently.
- Command-Line Arguments:
- Allow the user to pass the view name as a command-line argument.
- Export View Image:
- Provide an option to download an image of the view.
- Partial matches
- Handle the users providing an incomplete name
Getting Started
For Python Users
- Tableau Server Client (TSC) Library:
- The TSC library simplifies interactions with the Tableau Server REST API.
- TSC GitHub Repository
- Install using pip:
pip install tableauserverclient
PythonFor Other Languages
- Tableau REST API Reference:
- Use the REST API to interact with Tableau Server programmatically.
- Tableau REST API Documentation
Sample Input/Output
Enter the name of the Tableau view to search for: Sales Dashboard
Searching for views...
Found the following view(s):
1)
- View Name: Sales Dashboard
- View ID: e8f2a1b4-1234-5678-9abc-def012345678
- Workbook Name: Annual Sales Reports
- Project Name: Corporate Reports
- View URL: https://your-tableau-server/views/AnnualSalesReports/SalesDashboard
2)
- View Name: Regional Sales Dashboard
- View ID: f9a3b2c5-2345-6789-0bcd-ef1234567890
- Workbook Name: Regional Reports
- Project Name: Sales Team
- View URL: https://your-tableau-server/views/RegionalReports/RegionalSalesDashboard
Process completed successfully.
YAMLSubmission Guidelines
- Source Code:
- Publish your project publically in Github profile
- README:
- Include setup instructions.
- Describe how to run the program.
- Video of Solution:
- Include a video of your solution in the README file, you can publish on Youtube and embed the iframe. Or save the video file in the directory root.
- Comments:
- Ensure your code is well-commented.
- Submission:
- Submit your challenge in the following **forms**
Additional Resources
- Tableau Server Client (Python):
- Tableau REST API:
- Filtering and Sorting
- Authentication
- Community Support:
- Tableau Community Forums
- Stack Overflow (
tableau-api
tag) - DataDev Slack Channel
Conclusion
This challenge is a great opportunity to delve into Tableau’s programmatic interfaces and enhance your automation skills. By completing this task, you’ll gain valuable experience that can be applied to a wide range of projects involving data visualization and analysis.
We look forward to seeing your innovative solutions! Happy coding!
Solution
Coming Soon…