#pretty #log #parse

app kras

Detect, highlight and pretty print almost any structured data inside plain text

13 releases

0.3.3 May 19, 2021
0.3.2 Mar 23, 2021
0.2.3 Mar 14, 2021
0.2.2 Feb 5, 2021
0.1.1 Jul 29, 2020

#448 in Command line utilities

Download history 9/week @ 2021-02-20 2/week @ 2021-02-27 4/week @ 2021-03-06 34/week @ 2021-03-13 65/week @ 2021-03-20 26/week @ 2021-03-27 25/week @ 2021-04-03 47/week @ 2021-04-10 16/week @ 2021-04-17 1/week @ 2021-04-24 17/week @ 2021-05-01 7/week @ 2021-05-08 29/week @ 2021-05-15 2/week @ 2021-05-22 3/week @ 2021-05-29 14/week @ 2021-06-05

88 downloads per month

MIT license

175KB
1K SLoC

kras

kras - Detect, highlight and pretty print structured data

This tool can find structured data of any kind inside of plain string, parse it and pretty-print it:

It can detect and parse almost any kind of data:
json
python
rust

and probably many more. Don't hesitate to open an issue if your data wasn't processed correctly

USAGE:

    kras [FLAGS] [OPTIONS] [input]...

FLAGS:
        --debug          debug mode
    -C, --force-color    alias for --color yes
    -h, --help           Prints help information
    -s, --sort           sort keys
    -r, --recursive      try to parse nested strings
    -V, --version        Prints version information

OPTIONS:
    -c, --color <color>      colorize output [default: auto]  [possible values: yes, no, auto]
    -i, --indent <indent>    indentation. 0 to disable (colorization is stil performed) [default: 2]
    -w, --width <width>      maximum width of output [default: 80]

ARGS:
    <input>...    Input files or stdin

Using with pgcli

kras really shines when used for reading jsons stored in database. For pgcli add to your .config/pgcli/config

pager = kras -Csw120 | less -iRXF

Now your jsons will be pretty-printed! Hint: use \x

Acknowledgement

This tool is powered by these amazing libs: pom for parsing and pretty for pretty-printing

Trivia

The name kras comes from russian root крас- - a beginning of words such as красивый (pretty), красный (red) and красить (to paint). That's what this app does: makes data pretty and paints it red (but not only red)

Dependencies

~4MB
~81K SLoC