{"id":13413494,"url":"https://github.com/go-ffmt/ffmt","last_synced_at":"2025-03-14T19:32:28.798Z","repository":{"id":27325451,"uuid":"30799930","full_name":"go-ffmt/ffmt","owner":"go-ffmt","description":"Golang beautify data display for Humans","archived":false,"fork":false,"pushed_at":"2021-11-19T15:22:56.000Z","size":114,"stargazers_count":305,"open_issues_count":2,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-01T15:10:15.490Z","etag":null,"topics":["fmt","for-humans","formater","go","go-library","golang-library","prettify"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-ffmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-14T15:19:45.000Z","updated_at":"2024-09-25T06:37:06.000Z","dependencies_parsed_at":"2022-07-24T14:47:06.712Z","dependency_job_id":null,"html_url":"https://github.com/go-ffmt/ffmt","commit_stats":null,"previous_names":["wzshiming/ffmt"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-ffmt%2Fffmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-ffmt%2Fffmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-ffmt%2Fffmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-ffmt%2Fffmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-ffmt","download_url":"https://codeload.github.com/go-ffmt/ffmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221498762,"owners_count":16833057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fmt","for-humans","formater","go","go-library","golang-library","prettify"],"created_at":"2024-07-30T20:01:41.630Z","updated_at":"2024-10-26T05:30:59.576Z","avatar_url":"https://github.com/go-ffmt.png","language":"Go","readme":"# Golang beautify data display for Humans\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-ffmt/ffmt)](https://goreportcard.com/report/github.com/go-ffmt/ffmt)\n[![GoDoc](https://pkg.go.dev/badge/github.com/gopkg.in/ffmt.v1)](https://pkg.go.dev/gopkg.in/ffmt.v1)\n[![GitHub license](https://img.shields.io/github/license/go-ffmt/ffmt.svg)](https://github.com/go-ffmt/ffmt/blob/master/LICENSE)\n[![gocover.io](https://gocover.io/_badge/github.com/go-ffmt/ffmt)](https://gocover.io/github.com/go-ffmt/ffmt)\n\n- [English](https://github.com/go-ffmt/ffmt/blob/master/README.md)\n- [简体中文](https://github.com/go-ffmt/ffmt/blob/master/README_cn.md)\n\n## Usage\n\n[Examples](https://github.com/go-ffmt/ffmt/blob/master/examples/main.go)\n\n``` golang\npackage main\n\nimport (\n\tffmt \"gopkg.in/ffmt.v1\"\n)\n\nfunc main() {\n\texample()\n}\n\ntype mt struct {\n\tString string\n\tInt    int\n\tSlice  []int\n\tMap    map[string]interface{}\n}\n\nfunc example() {\n\tm := mt{\n\t\t\"hello world\",\n\t\t100,\n\t\t[]int{1, 2, 3, 4, 5, 6},\n\t\tmap[string]interface{}{\n\t\t\t\"A\":  123,\n\t\t\t\"BB\": 456,\n\t\t},\n\t}\n\n\tfmt.Println(m) // fmt the default formatting.\n\t/*\n\t\t{hello world 100 [1 2 3 4 5 6] map[BB:456 A:123]}\n\t*/\n\n\tffmt.Puts(m) // More friendly formatting.\n\t/*\n\t\t{\n\t\t String: \"hello world\"\n\t\t Int:    100\n\t\t Slice:  [\n\t\t  1 2 3\n\t\t  4 5 6\n\t\t ]\n\t\t Map: {\n\t\t  \"A\":  123\n\t\t  \"BB\": 456\n\t\t }\n\t\t}\n\t*/\n\n\tffmt.Print(m) // Same \"Puts\" but String unadded '\"'.\n\t/*\n\t\t{\n\t\t String: hello world\n\t\t Int:    100\n\t\t Slice:  [\n\t\t  1 2 3\n\t\t  4 5 6\n\t\t ]\n\t\t Map: {\n\t\t  A:  123\n\t\t  BB: 456\n\t\t }\n\t\t}\n\t*/\n\n\tffmt.P(m) // Format data and types.\n\t/*\n\t\tmain.mt{\n\t\t String: string(\"hello world\")\n\t\t Int:    int(100)\n\t\t Slice:  []int[\n\t\t  int(1) int(2) int(3)\n\t\t  int(4) int(5) int(6)\n\t\t ]\n\t\t Map: map[string]interface {}{\n\t\t  string(\"A\"):  int(123)\n\t\t  string(\"BB\"): int(456)\n\t\t }\n\t\t}\n\t*/\n\n\tffmt.Pjson(m) // Format it in json style.\n\t/*\n\t\t{\n\t\t \"Int\": 100\n\t\t,\"Map\": {\n\t\t  \"A\":  123\n\t\t ,\"BB\": 456\n\t\t }\n\t\t,\"Slice\": [\n\t\t  1,2,3\n\t\t ,4,5,6\n\t\t ]\n\t\t,\"String\": \"hello world\"\n\t\t}\n\t*/\n\n\tm0 := ffmt.ToTable(m, m) // Break the fields into tables.\n\tffmt.Puts(m0)\n\t/*\n\t\t[\n\t\t [\n\t\t  \"String\" \"Int\"\n\t\t  \"Slice\"  \"Map\"\n\t\t ]\n\t\t [\n\t\t  \"hello world\"   \"100\"\n\t\t  \"[1 2 3 4 5 6]\" \"map[A:123 BB:456]\"\n\t\t ]\n\t\t]\n\t*/\n\n\tm1 := ffmt.FmtTable(m0) // [][]string Table format.\n\tffmt.Puts(m1)\n\t/*\n\t\t[\n\t\t \"String      Int Slice         Map               \"\n\t\t \"hello world 100 [1 2 3 4 5 6] map[A:123 BB:456] \"\n\t\t]\n\t*/\n\n\tffmt.Mark(\"hello\") // Mark position.\n\t/*\n\t\tmain.go:124  hello\n\t*/\n\n\tffmt.Print(ffmt.BytesViewer(\"Hello world! Hello All!\"))\n\t/*\n  |  Address | Hex                                             | Text             |\n  | -------: | :---------------------------------------------- | :--------------- |\n  | 00000000 | 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 20 48 65 6c | Hello world! Hel |\n  | 00000010 | 6c 6f 20 41 6c 6c 21                            | lo All!          |\n\t*/\n}\n\n```\n\n## Sponsors\n\n[![jetbrains](https://www.jetbrains.com/shop/static/images/jetbrains-logo-inv.svg)](https://www.jetbrains.com/shop/eform/opensource)\n\n## License\n\nLicensed under the MIT License. See [LICENSE](https://github.com/go-ffmt/ffmt/blob/master/LICENSE) for the full license text.\n","funding_links":[],"categories":["开源类库","Go","Miscellaneous","Open source library","其他杂项","Microsoft Office","杂项","其他","Uncategorized"],"sub_categories":["调试","Strings","Uncategorized","Debugging","Advanced Console UIs","暂未分类","未分类的","交流","暂未分类这些库被放在这里是因为其他类别似乎都不适合。"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-ffmt%2Fffmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-ffmt%2Fffmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-ffmt%2Fffmt/lists"}