Data graphing library for command line.

Overview

DataBrush

DataBrush is a simple library for displaying structured data in the command line. In supports dividing data into chunks and highlighting certain elements of those chunks.

Example

    let sample = fs::read("/home/carstein/sample").unwrap();

    let mut example1 = Dataset::new(String::from("Executable file"), sample).unwrap();

    let mut chunk1 = match Chunk::new(String::from("elf header"), 52) {
        Ok(v) => v,
        Err(error) => panic!("Problem creating chunk: {:?}", error),
    };

    chunk1.set_highlight(
        Highlight::new(String::from("signature"), 0, 4).unwrap()).unwrap();
    chunk1.set_highlight(
        Highlight::new(String::from("e_entry"), 24, 4).unwrap()).unwrap();
    chunk1.set_highlight(
        Highlight::new(String::from("e_phoff"), 28, 4).unwrap()).unwrap();


    let chunk2 = match Chunk::new(String::from("program header table"), 32) {
        Ok(v) => v,
        Err(error) => panic!("Problem creating chunk: {:?}", error),
    };

    example1.add_chunk(chunk1).expect("Problem adding chunk");
    example1.add_chunk(chunk2).expect("Problem adding chunk");
    
    // Start painting
    let painter =  Painter::new();
    let sketch = painter.prepare(&example1);

This code will, if provided with an Elf file will display two chunks with three separate highlights. Like on an example below (of course Markdown does not preserve colors):

======== Executable file
00000000┃ 7F 45 4C 46 01 01 01 00   00 00 00 00 00 00 00 00  ┓
00000010┃ 02 00 03 00 01 00 00 00   F0 82 04 08 34 00 00 00  ┃ elf header
00000020┃ 48 11 00 00 00 00 00 00   34 00 20 00 09 00 28 00  ┃
00000030┃ 1E 00 1B 00                                        ┛
-- signature
-- e_entry
-- e_phoff

00000030┃             06 00 00 00   34 00 00 00 34 80 04 08  ┓
00000040┃ 34 80 04 08 20 01 00 00   20 01 00 00 05 00 00 00  ┃ program header table
00000050┃ 04 00 00 00                                        ┛

Problems/Plans

  • Better documentation
  • Better error handling
  • Terminal color detection (right now it just assumes it works)
  • Complete Api for manual dataset creation (as for now chunks needs to be added sequentionaly)
  • Helper method to read data structure from JSON
  • Support for dissecting bitfields
  • Optionally, raw data display (in addition to hex display)
You might also like...
⌚ A command-line tool (and library) for the rusty Swatch Internet Time.

⌚ A command-line tool (and library) for the rusty Swatch Internet Time. Comes with XBar/Swiftbar support.

A command-line tool for re-packaging an epub that has been unzipped. Can also be used as a library.

🎒 zaino A command-line tool for re-packaging an epub that has been unzipped. Can also be used as a library. Installation To use zaino as a library, a

A command line tool and Rust library for working with recombination maps.

RecMap library (and command line tool) for reading and working with recombination maps in Rust A RecMap object can be created from reading in a HapMap

Checkline: checkbox line picker for stdin line input

checkline is a Unix command line interface (CLI) terminal user interface (TUI) that prompts you to check each line of stdin, to pick each line to output to stdout

A full featured, fast Command Line Argument Parser for Rust

clap Command Line Argument Parser for Rust It is a simple-to-use, efficient, and full-featured library for parsing command line arguments and subcomma

Docopt for Rust (command line argument parser).

THIS CRATE IS UNMAINTAINED This crate is unlikely to see significant future evolution. The primary reason to choose this crate for a new project is if

Parse command line arguments by defining a struct.

StructOpt Parse command line arguments by defining a struct. It combines clap with custom derive. Documentation Find it on Docs.rs. You can also check

⚡️ Lightning-fast and minimal calendar command line. Written in Rust 🦀
⚡️ Lightning-fast and minimal calendar command line. Written in Rust 🦀

⚡️ Lightning-fast and minimal calendar command line. It's similar to cal. Written in Rust 🦀

Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.
Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.

paleatra v.0.0.1 Command-Line program that takes an image and produces the copy of the image with a thin frame and palette made of the 10 most frequen

Owner
Michal Melewski
Michal Melewski
A complex numbers, graphing, cli calculator

calc requires gnuplot for graphing history file is stored in ~/.config/.calc_history or C:\\Users\\%USERNAME%\\AppData\\Roaming\\calc.history usage Us

null 6 May 21, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Vitaly Shukela 3 Jan 3, 2023
ruborute is an interactive command-line tool to get asphyxia@sdvx gaming data.

ruborute Are you 暴龍天 ?. The ruborute is an interactive command-line tool to get asphyxia@sdvx gaming data. asphyxia-core/plugins: https://github.com/a

RinChanNOW! 9 Sep 28, 2022
Command line tool to extract various data from Blender .blend files

blendtool Command line tool to extract various data from Blender .blend files. Currently supports dumping Eevee irradiance volumes to .dds, new featur

null 2 Sep 26, 2021
Improved Notion data entry, at the command line

notion-entry NOTE: This project is a work in progress and has a pile of FIXMEs This program lets you input data into Notion from the command line. It

Jade Lovelace 1 Jan 16, 2022
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
A command line progress reporting library for Rust

indicatif Documentation A Rust library for indicating progress in command line applications to users. This currently primarily provides progress bars

Armin Ronacher 3.2k Dec 30, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

HashMismatch 47 Nov 25, 2022
colorStyle is a library of styles for command-line text write in Rust.

Colorstyle colorStyle is a library of styles for command-line text. Inspired by flylog/colorstyle (golang) Example let text = colorstyle::green("gre

Code Translation 6 Nov 12, 2022