5 releases (3 stable)

1.1.1 May 6, 2020
1.0.0 Apr 28, 2020
0.1.1 Apr 19, 2020
0.1.0 Apr 17, 2020

#147 in Command-line interface

Download history 31/week @ 2021-02-16 3/week @ 2021-02-23 5/week @ 2021-03-02 3/week @ 2021-03-09 5/week @ 2021-03-16 12/week @ 2021-03-23 35/week @ 2021-03-30 33/week @ 2021-04-06 11/week @ 2021-04-13 26/week @ 2021-04-20 4/week @ 2021-04-27 8/week @ 2021-05-04 2/week @ 2021-05-11 12/week @ 2021-05-18 5/week @ 2021-05-25 4/week @ 2021-06-01

59 downloads per month

MIT/Apache

64KB
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

~95–500KB