16 releases (stable)

new 1.1.5 Nov 27, 2024
1.1.1 Jul 21, 2024
1.0.4 Jun 13, 2022
0.1.5 Feb 26, 2022
0.1.4 Nov 14, 2021

#64 in Text processing

Download history 209/week @ 2024-07-31 132/week @ 2024-08-07 18/week @ 2024-08-14 52/week @ 2024-09-11 44/week @ 2024-09-18 33/week @ 2024-09-25 4/week @ 2024-10-02

1,117 downloads per month

GPL-3.0-only

150KB
3.5K SLoC

PREtty FIX

CI Status Latest Release

A commandline based pretty printer for FIX messages.

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

Prefix showcase

Usage

input can be passed in as an argument or piped in:

prefix "8=FIX4.4|1=test|55=EUR/USD|10=123|"
echo "8=FIX4.4|1=test|55=EUR/USD|10=123|" | prefix

outputs:

BeginString = FIX4.4
Account = test
Symbol = EUR/USD
CheckSum = 123

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.

# Pipe the file contents to prefix which parses and pipes them to awk, which prints them aligned.
cat example.txt | prefix -v | awk '{printf("%-20s %-30s\n", $1,$3)}'

outputs:

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

Or summarising a log file that includes FIX messages.

# Pipe the file contents to prefix which then summarises the FIX messages by instrument
cat example.log | prefix --summary 55 --only-fix | sort | uniq --count

outputs:

4 NewOrderSingle EUR/USD
4 ExecutionReport EUR/USD
2 NewOrderSingle USD/KRW
2 ExecutionReport USD/KRW

Installation

Can be installed using:

cargo install prefix

Issues

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

Dependencies

~3.5–5.5MB
~94K SLoC