Skip to main content

No project description provided

Project description

easyfix

Easy to use, low-boilerplate wrapper for QuickFIX (initiator only for now).

Motivation

Setting up a FIX application with QuickFIX is a lot of boilerplate. This is your easy fix.

This is mainly intended to experiment and explore with a FIX counterparty, or to be used in test cases. There is no effort made to make this suitable in a high performance setting.

Install

pip install easyfix

QuickFIX is not installed automatically, if you don't have it already:

pip install quickfix

Features

  • Minimalistic API for quick and no fuss FIX API exploration
  • Humanized output: converts enum fields to descriptions -- no more spending hours digging through FIX references
  • Automatically set your sequence number to the needed value if your counterparty tells you "MsgSeqNum too low". Just restarting your app if your connection gets hung usually fixes it.

Usage

More examples at example.py

Initiator

import quickfix as fix
import quickfix44 as fix44
import easyfix

# Enable verbose logging for troubleshooting
# easyfix.enable_logging()

# Finally, no need to create a whole class just to connect to a FIX server!
app = easyfix.InitiatorApp.create('example.cfg')
app.start()

while not app.logged_on:
    time.sleep(0.1)

print("Logged in!")

# Send message using normal QuickFIX messages
m = fix44.SecurityListRequest()
m.setField(fix.SecurityReqID(str(uuid.uuid4())))
m.setField(fix.SecurityListRequestType(fix.SecurityListRequestType_ALL_SECURITIES))
fix.Session.sendToTarget(m, app.session_id)

# Pull messages from a Queue
while m := app.incoming_messages.get():
    # Get field(s) by name
    #
    # Note that this does not consider repeating group hierarchies and dump
    # all fields matching the tag of the name
    #
    # Example output:
    #
    #   ["SecurityList"]
    #   ["BTC/USD", "ETH/BTC"]
    print(app.get_fields_by_name(m, 'MsgType'))
    print(app.get_fields_by_name(m, 'Symbol'))

    # Get "nicely" formatted FIX message dump. Enums are automatically converted to descriptions
    #
    # Example output:
    #
    #   BeginString=FIX.4.4|BodyLength=736|MsgType=SECURITY_LIST(y)|MsgSeqNum=1039|...
    print(app.humanize(m))

Verbose logging

You can get dump of FIX messages by enabling logging:

easyfix.enable_logging()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyfix-0.1.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

easyfix-0.1.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file easyfix-0.1.3.tar.gz.

File metadata

  • Download URL: easyfix-0.1.3.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for easyfix-0.1.3.tar.gz
Algorithm Hash digest
SHA256 17ecffae897ea9a7ecbe20311bdf926a00bd02e2d5acd4449b28e31bb7266fbf
MD5 c535b022b62f48f423c2fe07a880b4de
BLAKE2b-256 2877c9e115d9f297f8de154a94f502cb975bf22a3f0b88524c8db13988f10191

See more details on using hashes here.

File details

Details for the file easyfix-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: easyfix-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for easyfix-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d08adb104bf02c15bd526998681451d74da7e214beb94d7aef456243d697d8de
MD5 c5c6bce5e1d6508b421099e5964edebd
BLAKE2b-256 b0d102d12130a5cc839375d2c1fc08dc6d0f0729263bdab86ccf5c5405bdebe0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page