MyNixOS website logo
Description

Parse 'Tableau' Workbooks into Functional Data.

High-performance parsing of 'Tableau' workbook files into tidy data frames and dependency graphs for other visualization tools like R 'Shiny' or 'Power BI' replication.

twbparser twbparser logo

Tableau: TWB/TWBX

R-CMD-check pkgdown Codecov License:MIT Lifecycle:experimental

Parse Tableau TWB/TWBX files in R: extract datasources, joins, relationships, fields, and calculated fields, plus inspect and unpack TWBX assets. Built for large workbooks and Shiny integration.

Features

  • TWB/TWBX: open packaged workbooks and auto‑extract the largest .twb
  • Relationships & joins: parse legacy joins and modern (2020.2+) relationships
  • Calculated fields / parameters: list formulas, datatypes, roles, and parameter metadata
  • Datasources: connection classes/targets, inferred locations, field counts
  • Dependency graph: build/plot field dependency DAGs
  • TWBX assets: list/extract images, extracts, text files, etc.
  • Ergonomics: parser$summary (no parens), parser$overview, parser$pages, parser$pages_summary

Installation

# Install from GitHub (using pak)
install.packages("pak")
pak::pak("PrigasG/twbparser")

# Or using devtools
install.packages("devtools")
devtools::install_github("PrigasG/twbparser")

Quick Start

Summary for twb workbook

library(twbparser)
library(fs)

# Parse workbook
path <- fs::path_abs("path/to/workbook.twbx")
stopifnot(file.exists(path))

parser <- TwbParser$new(path)

# summary (prints)
parser$summary

# summary (one row tibble)
parser$overview

With a ".twbx" file

parser <- TWBParser$new("path/to/workbook.twbx")

# Inspect manifest
parser$twbx_manifest

Peek inside

# Datasources / parameters / all sources
parser$get_datasources()
parser$get_parameters()
parser$get_datasources_all()

# Fields and calculated fields (parameters excluded by default)
parser$get_fields()
parser$get_calculated_fields(pretty = TRUE, wrap = 120)

Page insights (dashboards, worksheets, stories)

# What pages exist?
parser$pages
# Or functional: twb_pages(parser)

# One-line summaries per page
parser$pages_summary

# What is on a page and where? (filters include x/y/w/h on dashboards)
parser$get_page_composition("Executive Dashboard")

# Filters across dashboards (with positions)
twb_dashboard_filters(parser)

# Chart/mark types per worksheet
twb_charts(parser)

# Colors and palettes referenced
twb_colors(parser)

Relationships/Joins

library(dplyr)
library(tidyr)

rel_df <- parser$get_relationships() |>
  mutate(
    op   = replace_na(operator, "="),
    left = paste0(left_table,  ".", left_field),
    right= paste0(right_table, ".", right_field),
    Join = paste(left, op, right)
  ) |>
  select(Join, datasource_left = left_table, datasource_right = right_table,
         operator, everything(), -left, -right, -left_is_calc, -right_is_calc)

rel_df

Nice tabular view for calculated fields

library(dplyr)

calcs <- parser$get_calculated_fields(pretty = TRUE, wrap = 120) |>
  select(Name = name, Formula = formula_pretty, Datasource = datasource)

# DT example optional:
# DT::datatable(calcs, escape = FALSE, rownames = FALSE,
#   options = list(scrollX = TRUE, pageLength = 50)) |>
#   DT::formatStyle("Formula", `white-space` = "pre", `font-family` = "monospace")

And graph objects (via igraph or ggraph) for visualization:

Rscript -e "twbparser::parse_twb('my_dashboard.twb', output_dir = 'results/')"

Integration Examples

  • R Shiny: Build an interactive dashboard showing calculations, filters, and DAG visualizations.
  • Power BI: Export calculated field logic to replicate measures in DAX.
  • Data lineage: Combine with DiagrammeR or visNetwork for workflow diagrams.

What’s new (0.3.0)

  • Page insights (pages, composition, summaries), filter positions on dashboards
  • No-parens parser$summary plus read-only properties (overview, pages, pages_summary, dashboard_summary)
  • Calculated fields exclude parameters by default; opt-in with include_parameters = TRUE

Contributing

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit changes (git commit -m 'Add new feature')
  4. Push branch (git push origin feature/new-feature)
  5. Open a Pull Request

License

This package is licensed under the MIT License — see the LICENSE file for details.

Metadata

Version

0.3.1

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows