Gotabulate

Gotabulate -- 使用 Go 轻松地打印你的表格数据。「Gotabulate - Easily pretty-print your tabular data with Go」

  • Owner: bndr/gotabulate
  • Platform: Linux, Mac, Windows
  • License:: Apache License 2.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Gotabulate - Easily pretty-print tabular data

GoDoc
Build Status

Summary

Go-Tabulate - Generic Go Library for easy pretty-printing of tabular data.

Installation

go get github.com/bndr/gotabulate

Description

Supported data types:

  • 2D Array of Int, Int64, Float64, String, interface{}
  • Map of String, interface{} (Keys will be used as header)

Usage

// Create Some Fake Rows
row_1 := []interface{}{"john", 20, "ready"}
row_2 := []interface{}{"bndr", 23, "ready"}

// Create an object from 2D interface array
t := gotabulate.Create([][]interface{}{row_1, row_2})

// Set the Headers (optional)
t.SetHeaders([]string{"age", "status"})

// Set the Empty String (optional)
t.SetEmptyString("None")

// Set Align (Optional)
t.SetAlign("right")

// Print the result: grid, or simple
fmt.Println(t.Render("grid"))

+---------+--------+-----------+

Main metrics

Overview
Name With Ownerbndr/gotabulate
Primary LanguageGo
Program languageGo (Language Count: 1)
PlatformLinux, Mac, Windows
License:Apache License 2.0
所有者活动
Created At2014-08-21 07:44:28
Pushed At2021-02-09 14:02:15
Last Commit At2021-02-09 15:02:14
Release Count3
Last Release Namev1.1.2 (Posted on 2014-09-20 15:15:23)
First Release Namev1.0 (Posted on 2014-09-19 15:25:14)
用户参与
Stargazers Count334
Watchers Count9
Fork Count32
Commits Count46
Has Issues Enabled
Issues Count9
Issue Open Count5
Pull Requests Count8
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private