Quick Start

One page summary of how to convert a workbook file to proto and JSON files by tableauc.

1. Download tableauc

Select the appropriate tableauc (aka Tableau Compiler) to download:

More platforms are available on tableau releases →.

2. Add a workbook

Add HelloWorld.xlsx with two sheets:

  • Item: Copy data below to this worksheet.
  • @TABLEAU: Just leave it empty now. It is the tableau metasheet → for specifying parser options.
IDNameDesc
map<int32, Item>stringstring
Item’s IDItem’s nameItem’s description
1AppleA kind of delicious fruit.
2OrangeA kind of sour fruit.
3BananaA kind of calorie-rich fruit.

3. Run tableauc

Run command: ./tableauc HelloWorld.xlsx

Then hello_world.proto and Item.json are generated:

hello_world.proto
syntax = "proto3";

package protoconf;

import "tableau/protobuf/tableau.proto";

option (tableau.workbook) = {name:"HelloWorld.xlsx"};

message Item {
  option (tableau.worksheet) = {name:"Item" namerow:1 typerow:2 noterow:3 datarow:4};

  map<int32, Item> item_map = 1 [(tableau.field) = {key:"ID" layout:LAYOUT_VERTICAL}];
  message Item {
    int32 id = 1 [(tableau.field) = {name:"ID"}];
    string name = 2 [(tableau.field) = {name:"Name"}];
    string desc = 3 [(tableau.field) = {name:"Desc"}];
  }
}
Item.json
{
    "itemMap": {
        "1": {
            "id": 1,
            "name": "Apple",
            "desc": "A kind of delicious fruit."
        },
        "2": {
            "id": 2,
            "name": "Orange",
            "desc": "A kind of sour fruit."
        },
        "3": {
            "id": 3,
            "name": "Banana",
            "desc": "A kind of calorie-rich fruit."
        }
    }
}

Congratulations! You’ve just run the tableauc to convert a workbook to proto and JSON files.