6 releases (stable)

1.1.2 Oct 3, 2021
1.1.1 May 6, 2020
1.0.0 Apr 28, 2020
0.1.1 Apr 19, 2020
0.1.0 Apr 17, 2020

#369 in Command-line interface

Download history 32/week @ 2023-10-23 49/week @ 2023-10-30 34/week @ 2023-11-06 31/week @ 2023-11-13 36/week @ 2023-11-20 62/week @ 2023-11-27 34/week @ 2023-12-04 36/week @ 2023-12-11 30/week @ 2023-12-18 36/week @ 2023-12-25 23/week @ 2024-01-01 34/week @ 2024-01-08 27/week @ 2024-01-15 23/week @ 2024-01-22 27/week @ 2024-01-29 21/week @ 2024-02-05

105 downloads per month
Used in 3 crates

MIT/Apache

66KB
1.5K SLoC

Stybulate - Tabulate with Style!

A Rust library (and a CLI binary) to create ASCII tables with styled borders. Inspired by the PyPi package https://pypi.org/project/tabulate/.

Build status Crates.io Rust Docs.rs License

Binary

Install with cargo install stybulate --features=cli.

See stybulate --help for options and arguments.

Library

Example

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.

Change log

See here

License

This project is licensed under either of

at your option.

Dependencies

~0.2–0.9MB
~13K SLoC