Pyfixmsg
pyfixmsg
is a library for parsing, manipulating and serialising FIX
messages, primarily geared towards testing. See the example.
Objectives
provide a rich API to compare and manipulate messages.
(mostly) Message type agnostic,
(mostly) value types agnostic
pluggable : load specification XML files, custom specifications or build your own Specification class for repeating groups definitions and message types, define your own codec for custom serialisation or deserialisation quirks.
Dependencies
six library (at least version 1.16.0).
Optional lxml for faster parsing of xml specification files.
Optional pytest to run the tests.
spec files from quickfix to get started with standard FIX specifications.
Core classes
FixMessage
. Inherits fromdict
. The workhorse class. By default comes with a codec that will parse standard-lookingFIX
, but without support repeating groups.
RepeatingGroup
. defines repeating groups of a FixMessage.
Codec
defines how to parse a buffer into a FixMessage, and how to serialise it back
FixSpec
defines theFIX
specification to follow. Only required for support of repeating group. Defined from Quickfix’s spec XML files.
How to run the tests
py.test --spec=/var/tmp/FIX44.xml
will launch the tests against the spec file in /var/tmp. You will need to load
the spec files from quickfix to get the tests to work.
The spec files are not included in this distribution.
Notes
This is only a FIX message library. It doesn’t include a FIX session management system or an order management core, or anything similar. It is purely message parsing-manipulation-serialisation. It is however easy to integrate into an order management or a exchange/broker simulator, etc.
- API Documentation
- FixMessage
FixMessage
FixMessage.FragmentType
FixMessage.__init__()
FixMessage.apply()
FixMessage.calculate_checksum()
FixMessage.checksum()
FixMessage.copy()
FixMessage.fix
FixMessage.from_buffer()
FixMessage.from_wire()
FixMessage.get_raw_message()
FixMessage.load_fix()
FixMessage.output_fix()
FixMessage.set_len_and_chksum()
FixMessage.set_or_delete()
FixMessage.tag_contains()
FixMessage.tag_exact()
FixMessage.tag_exact_dict()
FixMessage.tag_ge()
FixMessage.tag_gt()
FixMessage.tag_icontains()
FixMessage.tag_iexact()
FixMessage.tag_in()
FixMessage.tag_le()
FixMessage.tag_lt()
FixMessage.tag_match_regex()
FixMessage.tags
FixMessage.to_wire()
FixMessage.update_all()
FixFragment
- Repeating groups
- Codec
- FixTag
- FixSpec
- FixMessage
- Examples