Skip to content

tableauio/tableau

Repository files navigation

Tableau

Modern Configuration Converter

Release Status Testing Status Code Coverage GitHub release (latest SemVer including pre-releases) go.dev BSR GitHub

Tableau

A modern configuration converter based on Protobuf (proto3).

Prerequisites

Installation

API

Simply add the following import to your code, and then go [build|run|test] will automatically fetch the necessary dependencies:

import "github.com/tableauio/tableau"

tableauc

Install:

go install github.com/tableauio/tableau/cmd/tableauc@latest

Features

  • Convert Excel/CSV/XML/YAML to JSON/Text/Bin.
  • Use Protobuf to define the structure of Excel/CSV/XML/YAML.
  • Use Golang to develop the conversion engine.
  • Support multiple programming languages, thanks to Protobuf (proto3).

Concepts

  • Importer:
    • imports a Excel/CSV file to a in-memory book of Table sheets.
    • imports a XML/YAML file to a in-memory book of Document sheets.
  • Parsers:
    • protogen: converts Excel/CSV/XML/YAML files to Protoconf files.
    • confgen: converts Excel/CSV/XML/YAML with Protoconf files to JSON/Text/Bin files.
  • Exporter:
    • protogen: exports a tableau.Workbook to a proto file.
    • confgen: exports a protobuf message to a JSON/Text/Bin file.
  • Protoconf: a dialect of Protocol Buffers (proto3) extended with tableau options, aimed to define the structure of Excel/CSV/XML/YAML.

Design

See official document: Design.

Contribution

Requirements

Install buf

go install github.com/bufbuild/buf/cmd/buf@v1.67.0

Dev Workflow

Lint proto files:

buf lint

Build proto files (check for errors):

buf build

Generate Go code from proto files:

buf generate

Update dependencies in buf.lock:

buf dep update

Push modules to the BSR (CI only, requires BUF_TOKEN):

buf push --git-metadata --exclude-unnamed