tableau

package module
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 11 Imported by: 3

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenConf added in v0.9.6

func GenConf(protoPackage, indir, outdir string, setters ...options.Option) error

GenConf converts Excel/CSV/XML/YAML files to different configuration files: JSON, Text, and Bin.

func GenProto added in v0.9.6

func GenProto(protoPackage, indir, outdir string, setters ...options.Option) (err error)

GenProto converts Excel/CSV/XML/YAML files to protoconf files.

func Generate added in v0.9.14

func Generate(protoPackage, indir, outdir string, setters ...options.Option) error

Generate converts Excel/CSV/XML/YAML files to protoconf files and different configuration files: JSON, Text, and Bin.

func NewConfGenerator added in v0.10.6

func NewConfGenerator(protoPackage, indir, outdir string, options ...options.Option) *confgen.Generator

NewConfGenerator creates a new conf generator.

func NewConfGeneratorWithOptions added in v0.10.6

func NewConfGeneratorWithOptions(protoPackage, indir, outdir string, options *options.Options) *confgen.Generator

NewConfGeneratorWithOptions creates a new conf generator with options.

func NewImporter added in v0.10.6

func NewImporter(workbookPath string) (importer.Importer, error)

NewImporter creates a new importer of the specified workbook.

func NewProtoGenerator added in v0.10.6

func NewProtoGenerator(protoPackage, indir, outdir string, options ...options.Option) *protogen.Generator

NewProtoGenerator creates a new proto generator.

func NewProtoGeneratorWithOptions added in v0.10.6

func NewProtoGeneratorWithOptions(protoPackage, indir, outdir string, options *options.Options) *protogen.Generator

NewProtoGeneratorWithOptions creates a new proto generator with options.

func SetLang added in v0.10.6

func SetLang(lang string) error

SetLang sets the default language. E.g: en, zh.

Types

type VersionInfo added in v0.10.6

type VersionInfo struct {
	Version         string // version of tableau
	ProtogenVersion string // version of protogen module
	ConfgenVersion  string // version of confgen module
	// VCS info
	Revision     string
	Time         string
	Experimental string
}

VersionInfo holds versions of tableau's main modules and VCS info.

func GetVersionInfo added in v0.10.6

func GetVersionInfo() *VersionInfo

GetVersionInfo returns VersionInfo of tableau.

Directories

Path Synopsis
cmd
tableauc command
internal
strcase
Package strcase converts strings to various cases.
Package strcase converts strings to various cases.
strcase/camelcase
Package camelcase is a micro package to split the words of a camelcase type string into a slice of words.
Package camelcase is a micro package to split the words of a camelcase type string into a slice of words.
tools/cmd/ecode command
x/xerrors
Code generated by internal/tools/cmd/ecode.
Code generated by internal/tools/cmd/ecode.
Package load provides functions to load a protobuf message from different formats:
Package load provides functions to load a protobuf message from different formats:
log
Refer:
Refer:
proto
Package store provides functions to store a protobuf message to different formats: json, bin, and txt.
Package store provides functions to store a protobuf message to different formats: json, bin, and txt.
test
functest command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL