{"id":13413321,"url":"https://github.com/k0kubun/pp","last_synced_at":"2025-05-10T08:02:14.411Z","repository":{"id":23998800,"uuid":"27382506","full_name":"k0kubun/pp","owner":"k0kubun","description":"Colored pretty printer for Go language","archived":false,"fork":false,"pushed_at":"2025-05-01T23:35:21.000Z","size":184,"stargazers_count":1940,"open_issues_count":6,"forks_count":103,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-08T22:36:53.099Z","etag":null,"topics":["go","pretty-printer"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/k0kubun/pp/v3","language":"Go","has_issues":false,"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/k0kubun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"k0kubun"}},"created_at":"2014-12-01T14:15:31.000Z","updated_at":"2025-05-08T18:36:53.000Z","dependencies_parsed_at":"2024-06-18T11:12:39.665Z","dependency_job_id":"0436d3bd-cd7f-4443-bee1-4db5e569d50e","html_url":"https://github.com/k0kubun/pp","commit_stats":{"total_commits":165,"total_committers":25,"mean_commits":6.6,"dds":0.2666666666666667,"last_synced_commit":"6f55b4dc4b268e1f0c695978898e5bb3f901c322"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0kubun%2Fpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0kubun%2Fpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0kubun%2Fpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0kubun%2Fpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0kubun","download_url":"https://codeload.github.com/k0kubun/pp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166475,"owners_count":21864467,"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":["go","pretty-printer"],"created_at":"2024-07-30T20:01:37.659Z","updated_at":"2025-05-10T08:02:14.368Z","avatar_url":"https://github.com/k0kubun.png","language":"Go","funding_links":["https://github.com/sponsors/k0kubun"],"categories":["开源类库","Go","Open source library","Logging","语言资源库","日志记录"],"sub_categories":["调试","Debugging","Search and Analytic Databases","go","检索及分析资料库"],"readme":"# pp [![Go](https://github.com/k0kubun/pp/workflows/Go/badge.svg)](https://github.com/k0kubun/pp/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/k0kubun/pp/v3.svg)](https://pkg.go.dev/github.com/k0kubun/pp/v3)\n\nColored pretty printer for Go language\n\n![](http://i.gyazo.com/d3253ae839913b7239a7229caa4af551.png)\n\n## Usage\n\nJust call `pp.Print()`.\n\n```go\nimport \"github.com/k0kubun/pp/v3\"\n\nm := map[string]string{\"foo\": \"bar\", \"hello\": \"world\"}\npp.Print(m)\n```\n\n![](http://i.gyazo.com/0d08376ed2656257627f79626d5e0cde.png)\n\n### API\n\nfmt package-like functions are provided.\n\n```go\npp.Print()\npp.Println()\npp.Sprint()\npp.Fprintf()\n```\n\nSee [the documentation](https://pkg.go.dev/github.com/k0kubun/pp/v3#section-documentation) for API details.\n\n### Configuration\n\nThey can be customized globally with `pp.Default`.\n\n```go\npp.Default.SetColoringEnabled(false)\npp.Println() // no color\n```\n\nYou can also create individual instances that do not interfere with the default printer:\n\n```go\nmypp := pp.New()\nmypp.SetColoringEnabled(false)\nmypp.SetExportedOnly(true)\nmypp.SetOmitEmpty(true)\nmypp.Println()\n```\n\nSee [PrettyPrinter documentation](https://pkg.go.dev/github.com/k0kubun/pp/v3#PrettyPrinter) for all available configurations.\n\n### Custom colors\n\nIf you require, you may change the colors (all or some) for syntax highlighting:\n\n```go\n// Create a struct describing your scheme\nscheme := pp.ColorScheme{\n\tInteger:       pp.Green | pp.Bold,\n\tFloat:         pp.Black | pp.BackgroundWhite | pp.Bold,\n\tString:        pp.Yellow,\n}\n\n// Register it for usage\npp.Default.SetColorScheme(scheme)\n```\n\nLook into ColorScheme struct for the field names.\n\nIf you would like to revert to the default highlighting, you may do so by calling `pp.ResetColorScheme()`.\n\nOut of the following color flags, you may combine any color with a background color and optionally with the bold parameter. Please note that bold will likely not work on the windows platform.\n\n```go\n// Colors\nBlack\nRed\nGreen\nYellow\nBlue\nMagenta\nCyan\nWhite\n\n// Background colors\nBackgroundBlack\nBackgroundRed\nBackgroundGreen\nBackgroundYellow\nBackgroundBlue\nBackgroundMagenta\nBackgroundCyan\nBackgroundWhite\n\n// Other\nBold\n\n// Special\nNoColor\n```\n\n## Demo\n\n### Timeline\n\n![](http://i.gyazo.com/a8adaeec965db943486e35083cf707f2.png)\n\n### UserStream event\n\n![](http://i.gyazo.com/1e88915b3a6a9129f69fb5d961c4f079.png)\n\n### Works on windows\n\n![](http://i.gyazo.com/ab791997a980f1ab3ee2a01586efdce6.png)\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0kubun%2Fpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0kubun%2Fpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0kubun%2Fpp/lists"}