{"id":38254789,"url":"https://github.com/daniel-zimmer/pterm","last_synced_at":"2026-01-17T01:30:47.807Z","repository":{"id":57563215,"uuid":"318402143","full_name":"daniel-zimmer/pterm","owner":"daniel-zimmer","description":"Go package for printing structs as tables in the terminal.","archived":false,"fork":false,"pushed_at":"2020-12-04T05:00:39.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-21T09:58:23.176Z","etag":null,"topics":["go","golang","printing","teminal"],"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/daniel-zimmer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-04T04:23:28.000Z","updated_at":"2020-12-04T05:00:41.000Z","dependencies_parsed_at":"2022-08-31T05:01:33.469Z","dependency_job_id":null,"html_url":"https://github.com/daniel-zimmer/pterm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daniel-zimmer/pterm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zimmer%2Fpterm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zimmer%2Fpterm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zimmer%2Fpterm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zimmer%2Fpterm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-zimmer","download_url":"https://codeload.github.com/daniel-zimmer/pterm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-zimmer%2Fpterm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","printing","teminal"],"created_at":"2026-01-17T01:30:47.064Z","updated_at":"2026-01-17T01:30:47.773Z","avatar_url":"https://github.com/daniel-zimmer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pterm\n\nGo package for printing structs as tables in the terminal.\n\n---\n\npterm uses reflection to get struct field names and tags to define formatting behaviour.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Daniel-Zimmer/pterm\"\n\t\"math/rand\"\n\t\"time\"\n)\n\ntype Example struct {\n\tID   string `json:\"id\" pterm:\"2, right\"`\n\tName string `json:\"name\" pterm:\"2, elastic\"`\n\tSize string `json:\"size\" pterm:\"left\"`\n}\n\nfunc main() {\n\tsizes := []string{\"BIG\", \"MEDIUM\", \"SMALL\", \"TINY\"}\n\tnames := []string{\"Albert\", \"John\", \"Richard\", \"Mary\", \"Cleo\", \"Bernard\", \"Zimmer\"}\n\n\texamples := make([]Example, 0)\n\n\trand.Seed(time.Now().Unix())\n\tfor i := 0; i \u003c 15; i++ {\n\t\texamples = append(examples, Example{\n\t\t\tID:   fmt.Sprintf(\"%x\", rand.Int()),\n\t\t\tName: names[rand.Intn(len(names))],\n\t\t\tSize: sizes[rand.Intn(len(sizes))],\n\t\t},\n\t\t)\n\t}\n\n\tpterm.PrintTable(examples)\n\n}\n\n```\n\n## Tags\n\n### \"left\"\nAligns to the **left**.\n\n\n### \"right\"\nAligns to the **right**.\n\n\n### any number\nHow much **padding** to leave before the next column.\n\nExample: \"2\"\n\n### \"ignore\"\n**Ignores** the field.\n\n### \"elastic\"\nTrims the strings in this column that would not fit in the terminal.\nOnly one field can be elastic.\n\n(99% sure this does not work on Windows)\n\nExample: if one of the entries in the table is: **\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"** and the terminal is not wide enough to fit the entire string, the displayed value will be something like: **\"Lorem ipsum dolor sit...\"**.\n\n### any name:\n\n**Name** to use as **column header** instead of the name of the struct field.\nIf you want to use any of the above keywords as struct names just add a \"$\" in front of the name.\n\nExample: \"$left\"\n\nIf you want the column header to start with a \"$\" just use \"$$\" instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-zimmer%2Fpterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-zimmer%2Fpterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-zimmer%2Fpterm/lists"}