Skip to content

guigui64/stybulate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Tabulate with Style

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •