Crates.io | stybulate |
lib.rs | stybulate |
version | 1.1.2 |
source | src |
created_at | 2020-04-17 17:20:09.812892 |
updated_at | 2021-10-03 21:42:24.967552 |
description | Tabulate with Style |
homepage | https://github.com/guigui64/stybulate |
repository | https://github.com/guigui64/stybulate |
max_upload_size | |
id | 231246 |
size | 732,556 |
A Rust library (and a CLI binary) to create ASCII tables with styled borders. Inspired by the PyPi package https://pypi.org/project/tabulate/.
Install with cargo install stybulate --features=cli
.
See stybulate --help
for options and arguments.
use stybulate::{Table, Style, Cell, Headers};
let result = Table::new(
Style::Fancy,
vec![
vec![Cell::from("answer"), Cell::Int(42)],
vec![Cell::from("pi"), Cell::Float(3.1415)],
],
Some(Headers::from(vec!["strings", "numbers"])),
).tabulate();
let expected = vec![
"╒═══════════╤═══════════╕",
"│ strings │ numbers │",
"╞═══════════╪═══════════╡",
"│ answer │ 42 │",
"├───────────┼───────────┤",
"│ pi │ 3.1415 │",
"╘═══════════╧═══════════╛",
].join("\n");
assert_eq!(expected, result);
See examples for more detailed examples.
See here
This project is licensed under either of
at your option.