UXY: Adding structure to the UNIX tools
Treating everything as a string is the way through which the great power and
versatility of UNIX tools is achieved. However, sometimes the constant
parsing of strings gets a bit cumbersome.
UXY is a tool to manipulate UXY format, which is
basically a two-dimensional table that's both human- and machine-readable.
The format is deliberately designed to be as similar to the output of
standard tools, such as ls
or ps
, as possible.
UXY tool also wraps some common UNIX tools and exports their output in
UXY format. Along with converters from/to other common data formats
(e.g. JSON) it is meant to allow for quick and painless access to the data.
Examples
TOOLS
UXY tools
All UXY tools take input from stdin and write the result to stdout.
The tools follow the Postel's principle: "Be liberal in what you accept,
conservative in what you output." They accept any UXY input, but
they try to align the fields in the output to make it more convenient to read.
- uxy align
- uxy from-csv
- uxy from-json
- uxy from-yaml
- uxy grep
- uxy import
- uxy fmt
- uxy to-csv
- uxy to-json
- uxy to-yaml
- uxy trim
Wrapped UNIX tools
Any argument that could be passed to the original tool can also be passed to
the UXY-wrapped version of the tool.
The exception are the arguments that modify how the output looks like. UXY
manages those arguments itself. The only control you have over the output is
to either print the default (short) set of result fields (mostly defined
as "the most useful info that fits on page") or long set of result fields
("all the information UXY was able to extract"):
When running with -l
option it often happens that the output exceeds the
terminal width, gets wrapped and unreadable. In such cases you can either
filter out just the fields you are intersed in using fmt
subcommand or
convert the result to YAML (uxy to-yaml
) which happens to render each field
on a separate line:
TESTING
To test, run ./test
script.