{"id":16461572,"url":"https://github.com/stringbean/text-utils","last_synced_at":"2026-06-10T06:39:17.501Z","repository":{"id":49266574,"uuid":"238701011","full_name":"stringbean/text-utils","owner":"stringbean","description":"Simple Text Utils for Scala","archived":false,"fork":false,"pushed_at":"2024-10-21T10:31:12.000Z","size":1163,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-10T05:16:33.392Z","etag":null,"topics":["scala","text","text-generators"],"latest_commit_sha":null,"homepage":"https://stringbean.github.io/text-utils","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stringbean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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}},"created_at":"2020-02-06T13:56:55.000Z","updated_at":"2024-10-21T10:31:15.000Z","dependencies_parsed_at":"2024-10-21T14:15:51.752Z","dependency_job_id":null,"html_url":"https://github.com/stringbean/text-utils","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Ftext-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Ftext-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Ftext-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringbean%2Ftext-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stringbean","download_url":"https://codeload.github.com/stringbean/text-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240988713,"owners_count":19889552,"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":["scala","text","text-generators"],"created_at":"2024-10-11T11:08:42.810Z","updated_at":"2026-06-10T06:39:12.476Z","avatar_url":"https://github.com/stringbean.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/github/actions/workflow/status/stringbean/text-utils/ci.yml)](https://github.com/stringbean/text-utils/actions/workflows/ci.yml)\n[![Codacy Grade](https://img.shields.io/codacy/grade/7b07263adca449ee8e51133b87af5030.svg?label=codacy)](https://www.codacy.com/app/stringbean/text-utils)\n[![Maven Central - Scala 2.12](https://img.shields.io/maven-central/v/software.purpledragon/text-utils_2.12.svg?label=scala%202.12)](https://search.maven.org/search?q=g:software.purpledragon%20a:text-utils_2.12)\n[![Maven Central - Scala 2.13](https://img.shields.io/maven-central/v/software.purpledragon/text-utils_2.13.svg?label=scala%202.13)](https://search.maven.org/search?q=g:software.purpledragon%20a:text-utils_2.13)\n[![Maven Central - Scala 3](https://img.shields.io/maven-central/v/software.purpledragon/text-utils_3.svg?label=scala%203)](https://search.maven.org/search?q=g:software.purpledragon%20a:text-utils_3)\n\n# Simple Text Utils for Scala\n\n`text-utils` is a collection of useful utilities for formatting text.\n\n## Quickstart\n\nAdd the following to your `build.sbt`:\n\n```scala\nlibraryDependencies += \"software.purpledragon\" %% \"text-utils\" % \"\u003cversion\u003e\"\n```\n\n## Table Formatting\n\n`TableFormatter` and `SortedTableFormatter` provide mechanisms for building and printing tabular data.\n\nThe simplest case is outputting a bare table without headers:\n\n```scala\nTableFormatter()\n  .addRow(\"Apples\", \"25\")\n  .addRow(\"Pears\", \"10\")\n  .addRow(\"Bananas\", \"4\")\n  .print()\n```\n\nWill output:\n\n```text\nApples   25\nPears    10\nBananas  4\n```\n\nTables can also be sorted and have a header:\n\n```scala\nSortedTableFormatter(\"Produce\", \"Remaining\")\n  .addRow(\"Apples\", \"25\")\n  .addRow(\"Pears\", \"10\")\n  .addRow(\"Bananas\", \"4\")\n  .print()\n```\n\nWill output:\n\n```text\n| Produce | Remaining |\n-----------------------\n| Apples  | 25        |\n| Bananas | 4         |\n| Pears   | 10        |\n```\n\nFull details can be found in the [documentation](https://stringbean.github.io/text-utils/tables.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringbean%2Ftext-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstringbean%2Ftext-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringbean%2Ftext-utils/lists"}