{"id":19543303,"url":"https://github.com/uutils/uutils-term-grid","last_synced_at":"2026-03-10T00:00:19.975Z","repository":{"id":63475039,"uuid":"551890456","full_name":"uutils/uutils-term-grid","owner":"uutils","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-07T22:08:35.000Z","size":131,"stargazers_count":12,"open_issues_count":7,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-08T03:52:04.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/uutils.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-15T10:21:52.000Z","updated_at":"2026-03-07T22:08:17.000Z","dependencies_parsed_at":"2024-04-27T19:23:33.342Z","dependency_job_id":"2ceb25f3-ef8c-4df5-971f-703e0e214216","html_url":"https://github.com/uutils/uutils-term-grid","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/uutils/uutils-term-grid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fuutils-term-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fuutils-term-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fuutils-term-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fuutils-term-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uutils","download_url":"https://codeload.github.com/uutils/uutils-term-grid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uutils%2Fuutils-term-grid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30317547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-11-11T03:18:16.521Z","updated_at":"2026-03-10T00:00:19.953Z","avatar_url":"https://github.com/uutils.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Crates.io](https://img.shields.io/crates/v/uutils-term-grid.svg)](https://crates.io/crates/uutils-term-grid)\n[![dependency status](https://deps.rs/repo/github/uutils/uutils-term-grid/status.svg)](https://deps.rs/repo/github/uutils/uutils-term-grid)\n[![CodeCov](https://codecov.io/gh/uutils/uutils-term-grid/branch/main/graph/badge.svg)](https://codecov.io/gh/uutils/uutils-term-grid)\n[![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/uutils/uutils-term-grid)\n\n# uutils-term-grid\n\nThis library arranges textual data in a grid format suitable for fixed-width\nfonts, using an algorithm to minimise the amount of space needed.\n\n---\n\nThis library is forked from the unmaintained\n[`rust-term-grid`](https://github.com/ogham/rust-term-grid) library. The core\nfunctionality has remained the same, with some additional bugfixes, performance\nimprovements and a new API.\n\n---\n\n# Installation\n\nThis crate works with `cargo`. Add the following to your `Cargo.toml`\ndependencies section:\n\n```toml\n[dependencies]\nuutils_term_grid = \"0.7\"\n```\n\nThe Minimum Supported Rust Version is 1.70.\n\n## Creating a grid\n\nTo add data to a grid, first create a new [`Grid`] value with a list of strings\nand a set of options.\n\nThere are three options that must be specified in the [`GridOptions`] value that\ndictate how the grid is formatted:\n\n- [`filling`][filling]: how to fill empty space between columns:\n  - [`Filling::Spaces`][Spaces] number of spaces between columns;\n  - [`Filling::Text`][Text] text string separator between columns;\n  - [`Filling::Tabs`][Tabs] special option which allows to set number of spaces between columns and set the size of `\\t` character.\n- [`direction`][direction]: specifies whether the cells should go along rows, or\n  columns:\n  - [`Direction::LeftToRight`][LeftToRight] starts them in the top left and\n    moves _rightwards_, going to the start of a new row after reaching the final\n    column;\n  - [`Direction::TopToBottom`][TopToBottom] starts them in the top left and\n    moves _downwards_, going to the top of a new column after reaching the final\n    row.\n- [`width`][width]: the width to fill the grid into. Usually, this should be the\n  width of the terminal.\n\nIn practice, creating a grid can be done as follows:\n\n```rust\nuse term_grid::{Grid, GridOptions, Direction, Filling};\n\n// Create a `Vec` of text to put in the grid\nlet cells = vec![\n    \"one\", \"two\", \"three\", \"four\", \"five\", \"six\",\n    \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\"\n];\n\n// Then create a `Grid` with those cells.\n// The grid requires several options:\n//  - The filling determines the string used as separator\n//    between the columns.\n//  - The direction specifies whether the layout should\n//    be done row-wise or column-wise.\n//  - The width is the maximum width that the grid might\n//    have.\nlet grid = Grid::new(\n    cells,\n    GridOptions {\n        filling: Filling::Spaces(1),\n        direction: Direction::LeftToRight,\n        width: 24,\n    }\n);\n\n// A `Grid` implements `Display` and can be printed directly.\nprintln!(\"{grid}\");\n```\n\nProduces the following tabular result:\n\n```text\none  two three  four\nfive six seven  eight\nnine ten eleven twelve\n```\n\n[filling]: https://docs.rs/uutils_term_grid/latest/term_grid/struct.GridOptions.html#structfield.filling\n[direction]: https://docs.rs/uutils_term_grid/latest/term_grid/struct.GridOptions.html#structfield.direction\n[width]: https://docs.rs/uutils_term_grid/latest/term_grid/struct.GridOptions.html#structfield.width\n[LeftToRight]: https://docs.rs/uutils_term_grid/latest/term_grid/enum.Direction.html#variant.LeftToRight\n[TopToBottom]: https://docs.rs/uutils_term_grid/latest/term_grid/enum.Direction.html#variant.TopToBottom\n[Spaces]: https://docs.rs/uutils_term_grid/latest/term_grid/enum.Filling.html#variant.Spaces\n[Text]: https://docs.rs/uutils_term_grid/latest/term_grid/enum.Filling.html#variant.Text\n[Tabs]:https://docs.rs/uutils_term_grid/latest/term_grid/enum.Filling.html#variant.Tabs\n\n## Width of grid cells\n\nThis library calculates the width of strings as displayed in the terminal using\nthe [`ansi-width`][ansi-width] crate. This takes into account the width of\ncharacters and ignores ANSI codes.\n\nThe width calculation is currently not configurable. If you have a use-case for\nwhich this calculation is wrong, please open an issue.\n\n[ansi-width]: https://docs.rs/ansi-width\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuutils%2Fuutils-term-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuutils%2Fuutils-term-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuutils%2Fuutils-term-grid/lists"}