10 releases (5 stable)

1.0.4 Jun 13, 2022
1.0.3 Jun 12, 2022
1.0.1 May 18, 2022
0.1.5 Feb 26, 2022
0.1.0 Aug 30, 2021

#556 in Text processing

GPL-3.0-only

38KB
1.5K SLoC

PREtty FIX

A commandline based pretty printer for FIX messages.

Based on a FIX4.4 dictionary, but is usable with most versions.

Usage

Mainly developed with unix piping in mind:

echo 8=4.4^1=test | prefix

But can also provide a message as an argument:

prefix 8=4.4^1=test

outputs:

BeginString = 4.4
Account = test

Currently can use ^ and | and SOH as delimiters.

Use prefix --help or man prefix for more details.

Piping

Unix piping greatly increases the potential uses. For example: Parsing a log file and aligning the values for easy scan reading.

# Creates the example log file.
echo "8=FIX.4.4|1=TEST^55=EUR/USD|150=1" > example.log
# Pipes the contents to prefix which parses and pipes them to awk, which prints them aligned.
cat example.log | prefix -v | awk '{printf("%-20s %-30s\n", $1,$3)}'

outputs:

BeginString          FIX.4.4
Account              TEST
Symbol               EUR/USD
ExecType             PartialFill

Installation

Can be installed using:

cargo install prefix

Issues

Any bugs/ requests can be added to the issues page on the github repository.

Dependencies

~6MB
~112K SLoC