{"id":31209865,"url":"https://github.com/nemeslaszlo/tableau-api-python","last_synced_at":"2026-01-20T17:27:14.355Z","repository":{"id":314112989,"uuid":"1053710603","full_name":"NemesLaszlo/Tableau-API-Python","owner":"NemesLaszlo","description":"Python wrapper around Tableau API","archived":false,"fork":false,"pushed_at":"2025-09-20T14:24:32.000Z","size":227,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-20T16:27:09.791Z","etag":null,"topics":["python","tableau","tableau-api","wrapper"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/tableau-api-client/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NemesLaszlo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-09T20:21:44.000Z","updated_at":"2025-09-20T14:24:36.000Z","dependencies_parsed_at":"2025-09-10T18:38:42.390Z","dependency_job_id":"0fc324b2-9f90-4f88-aa07-5730bab16aaa","html_url":"https://github.com/NemesLaszlo/Tableau-API-Python","commit_stats":null,"previous_names":["nemeslaszlo/tableau-api-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NemesLaszlo/Tableau-API-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NemesLaszlo%2FTableau-API-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NemesLaszlo%2FTableau-API-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NemesLaszlo%2FTableau-API-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NemesLaszlo%2FTableau-API-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NemesLaszlo","download_url":"https://codeload.github.com/NemesLaszlo/Tableau-API-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NemesLaszlo%2FTableau-API-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276187723,"owners_count":25599857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","tableau","tableau-api","wrapper"],"created_at":"2025-09-21T03:11:28.618Z","updated_at":"2025-09-21T03:11:31.954Z","avatar_url":"https://github.com/NemesLaszlo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tableau API Client\n\nA comprehensive Python client library for the Tableau Server REST API, providing easy-to-use interfaces for managing Tableau Server resources programmatically.\n\n## Features\n\n- **Complete API Coverage**: Support for all major Tableau Server REST API endpoints\n- **Type Safety**: Full type hints and auto-generated models from Tableau's API specification\n- **Authentication Management**: Username/password and Personal Access Token (PAT) authentication\n- **Version Compatibility**: Support for multiple Tableau API versions\n- **Pagination Support**: Built-in pagination handling for large result sets\n- **Error Handling**: Comprehensive exception handling with detailed error messages\n- **Content Management**: Query, filter, and manage workbooks, data sources, projects, users, and more\n- **Tagging System**: Add, remove, and manage tags on content\n- **Modular Design**: Organized client modules for different API domains\n\n## Installation\n\n```bash\npip install tableau-api-client\n```\n\n## Quick Start\n\n### Basic Authentication and Querying\n\n```python\nfrom tableau_api_client import TableauApiClient\n\n# Initialize the client\nclient = TableauApiClient(\n    tableau_base_uri='https://your-tableau-server.com',\n    api_version='3.19'\n)\n\n# Sign in with username/password\nsession = client.authentication.sign_in(\n    user_name='your_username',\n    password='your_password',\n    site_content_url='your_site'  # Use '' for default site with basic configuration\n)\n\n# List all projects with pagination\nall_projects = []\npage_number = 1\n\nwhile True:\n    pagination, projects = client.projects.query_projects(\n        session=session,\n        page_size=100,\n        page_number=page_number\n    )\n    \n    if not projects:\n        break\n        \n    all_projects.extend(projects)\n    \n    # Check if we've reached the end\n    if len(projects) \u003c 100:\n        break\n        \n    page_number += 1\n\nfor project in all_projects:\n    print(f\"Project: {project.name} (ID: {project.id})\")\n\n# Sign out\nclient.authentication.sign_out(session)\n```\n\n### Personal Access Token Authentication\n\n```python\n# Sign in with PAT (recommended for automation)\nsession = client.authentication.sign_in_with_pat(\n    token_name='your_pat_name',\n    token='your_pat_token',\n    site_content_url='your_site'\n)\n```\n\n## API Modules\n\nThe client is organized into logical modules:\n\n- **authentication**: Sign in/out, manage sessions and tokens\n- **projects**: Project operations and management\n- **workbooks_views**: Workbook and view management\n- **datasources**: Data source management\n- **users_groups**: User and group management\n- **sites**: Site administration\n- **permissions**: Permission management\n- **publishing**: Publish workbooks and data sources\n- **jobs_tasks_schedules**: Background jobs and schedules\n- **server**: Server information and settings\n- **subscriptions**: Manage subscriptions\n- **favorites**: Manage favorites\n- **flows**: Tableau flows\n- **revisions**: Content revisions\n\n## Working with Content\n\n### Querying Workbooks\n\n```python\n# Get all workbooks with pagination\nall_workbooks = []\npage_number = 1\n\nwhile True:\n    pagination, workbooks = client.workbooks_views.query_workbooks_for_site(\n        session=session,\n        page_size=50,\n        page_number=page_number\n    )\n    \n    if not workbooks:\n        break\n        \n    all_workbooks.extend(workbooks)\n    \n    if len(workbooks) \u003c 50:  # Last page\n        break\n        \n    page_number += 1\n\n# Display workbook information\nfor workbook in all_workbooks:\n    print(f\"Workbook: {workbook.name}\")\n    print(f\"  Project: {workbook.project.name}\")\n    print(f\"  Owner: {workbook.owner.name}\")\n    print(f\"  Created: {workbook.created_at}\")\n    print(f\"  Size: {workbook.size}\")\n```\n\n### Querying Data Sources\n\n```python\n# Get all data sources with pagination\npagination, datasources = client.datasources.query_data_sources(\n    session=session,\n    page_size=100,\n    sort_expression=\"name:asc\"  # Sort by name\n)\n\nfor datasource in datasources:\n    print(f\"Data Source: {datasource.name}\")\n    print(f\"  Type: {datasource.type_value}\")\n    print(f\"  Project: {datasource.project.name}\")\n    print(f\"  Certified: {getattr(datasource, 'is_certified', False)}\")\n```\n\n### Getting Detailed Information\n\n```python\n# Get detailed workbook information\ndetailed_workbook = client.workbooks_views.query_workbook(\n    session=session,\n    workbook_id=workbook_id\n)\n\nprint(f\"Workbook: {detailed_workbook.name}\")\nprint(f\"Description: {detailed_workbook.description}\")\nprint(f\"Show Tabs: {detailed_workbook.show_tabs}\")\n\n# List views in the workbook\nif detailed_workbook.views and detailed_workbook.views.view:\n    print(\"Views:\")\n    for view in detailed_workbook.views.view:\n        print(f\"  - {view.name} (ID: {view.id})\")\n```\n\n### Content Tagging\n\n```python\n# Add tags to a workbook\ntest_tags = [\"production\", \"financial-data\", \"automated-refresh\"]\n\nadded_tags = client.workbooks_views.add_tags_to_workbook(\n    session=session,\n    workbook_id=workbook_id,\n    tags_to_add=test_tags\n)\n\nprint(f\"Added {len(added_tags)} tags:\")\nfor tag in added_tags:\n    print(f\"  - {tag.label}\")\n\n# Add tags to a data source\ndatasource_tags = [\"raw-data\", \"daily-refresh\"]\n\nadded_ds_tags = client.datasources.add_tags_to_data_source(\n    session=session,\n    datasource_id=datasource_id,\n    tags_to_add=datasource_tags\n)\n\n# Remove tags\nclient.workbooks_views.delete_tag_from_workbook(\n    session=session,\n    workbook_id=workbook_id,\n    tag_name=\"production\"\n)\n```\n\n### Filtering and Sorting\n\n```python\n# Filter workbooks by name\npagination, filtered_workbooks = client.workbooks_views.query_workbooks_for_site(\n    session=session,\n    filter_expression=\"name:eq:Sales Dashboard\",\n    page_size=10\n)\n\n# Sort data sources by creation date\npagination, sorted_datasources = client.datasources.query_data_sources(\n    session=session,\n    sort_expression=\"createdAt:desc\",\n    page_size=20\n)\n```\n\n## Advanced Usage\n\n### Custom Configuration\n\n```python\nfrom tableau_api_client import TableauApiClient\nimport logging\nfrom datetime import timedelta\n\n# Configure logging\nlogging.basicConfig(level=logging.DEBUG)\nlogger = logging.getLogger('tableau_client')\n\n# Initialize with custom settings\nclient = TableauApiClient(\n    tableau_base_uri='https://your-server.com',\n    api_version='3.19',\n    logger=logger,\n    timeout=timedelta(minutes=10),\n    ignore_ssl_errors=False  # Set to True for self-signed certificates\n)\n```\n\n### Error Handling\n\n```python\nfrom tableau_api_client.exceptions import (\n    TableauRequestException,\n    TableauApiVersionException,\n    TableauOnlineNotSupportedException\n)\n\ntry:\n    session = client.authentication.sign_in(username, password, site_name)\n    \n    # Perform operations\n    pagination, projects = client.projects.query_projects(session)\n    \nexcept TableauRequestException as e:\n    print(f\"Request failed: {e.message}\")\n    print(f\"Status code: {e.status_code}\")\n    if e.has_details:\n        print(f\"Error details: {e.details}\")\n        \nexcept TableauApiVersionException as e:\n    print(f\"API version too low: {e.message}\")\n    print(f\"Required: {e.version_required}, Current: {e.current_version}\")\n    \nexcept TableauOnlineNotSupportedException as e:\n    print(f\"Feature not available in Tableau Online: {e.message}\")\n```\n\n### Publishing Content\n\n```python\n# Publishing a workbook\nwith open('my_workbook.twbx', 'rb') as workbook_file:\n    published_workbook = client.publishing.publish_workbook(\n        session=session,\n        project_id='project-id',\n        workbook_name='My Workbook',\n        file_upload=workbook_file,\n        overwrite=True\n    )\n\n# Publishing a data source\nwith open('my_datasource.tdsx', 'rb') as datasource_file:\n    published_ds = client.publishing.publish_datasource(\n        session=session,\n        project_id='project-id',\n        datasource_name='My Data Source',\n        file_upload=datasource_file\n    )\n```\n\n## API Version Compatibility\n\nThe client automatically handles version compatibility and will raise `TableauApiVersionException` if you try to use a feature that requires a newer API version than configured.\n\n```python\ntry:\n    # This method might require API version 3.0+\n    result = client.some_advanced_feature(session)\nexcept TableauApiVersionException as e:\n    print(f\"Upgrade to API version {e.version_required} to use this feature\")\n    print(f\"Current version: {e.current_version}\")\n```\n\n## Supported Tableau Versions\n\n- Tableau Server 2018.1 and later\n- Tableau Online (Cloud)\n- API versions\n\n## Requirements\n\n- Python 3.7+\n- requests \u003e= 2.28.0\n- xsdata[lxml] \u003e= 23.8\n- typing-extensions \u003e= 4.0.0\n- urllib3 \u003e= 2.5.0\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/NemesLaszlo/Tableau-API-Python/blob/main/LICENSE) file for details.\n\n## Support\n\n- [GitHub Issues](https://github.com/NemesLaszlo/Tableau-API-Python/issues)\n- [Tableau REST API Documentation](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api.htm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemeslaszlo%2Ftableau-api-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemeslaszlo%2Ftableau-api-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemeslaszlo%2Ftableau-api-python/lists"}