jetblack_fixparser

module jetblack_fixparser

Summary

jetblack_fixparser

function jetblack_fixparser.loader.load_quickfix_protocol

Summary

Load a QuickFix style XML protocol file

jetblack_fixparser.loader.load_quickfix_protocol(
filename: str,
*,
is_millisecond_time: bool,
is_float_decimal: bool,
is_type_enum: Optional[Mapping[ValueType, bool]]
) -> ProtocolMetaData

Parameters

filename: str (optional)

The filename

is_millisecond_time: bool

If true times have milliseconds. Defaults to True.

is_float_decimal: bool

If true use Decimal for floating point numbers. Defaults to False.

is_type_enum: Optional[Mapping[ValueType, bool]]

A map of types to control serialization to enums. Defaults to None.

Returns

ProtocolMetaData: The protocol meta data.

function jetblack_fixparser.loader.load_yaml_protocol

Summary

Load a YAML style protocol file

jetblack_fixparser.loader.load_yaml_protocol(
filename: str,
*,
is_millisecond_time: bool,
is_float_decimal: bool,
is_type_enum: Optional[Mapping[ValueType, bool]]
) -> ProtocolMetaData

Parameters

filename: str (optional)

The filename

is_millisecond_time: bool

If true times have milliseconds. Defaults to True.

is_float_decimal: bool

If true use Decimal for floating point numbers. Defaults to False.

is_type_enum: Optional[Mapping[ValueType, bool]]

Map controlling serialization to enums. Defaults to None.

Returns

ProtocolMetaData: The protocol meta data.

class FixMessage

Summary

Initialise the FIX message

jetblack_fixparser.fix_message.FixMessage(
message: Mapping[str, Any],
meta_data: Optional[MessageMetaData]
) -> None

Parameters

message: Mapping[str, Any] (optional)

The fix message in the form of a mapping of message names to values.

meta_data: Optional[MessageMetaData]

Optional meta data. If this is not supplied it will be discovered from the protocol meta data. Defaults to None.

class method FixMessage.decode

Summary

Decode a FIX bytes buffer.

FixMessage.decode(
buffer: bytes,
*,
strict: bool,
validate: bool,
sep: bytes,
convert_sep_for_checksum: bool
) -> FixMessage

Parameters

buffer: bytes (optional)

The FIX bytes buffer.

strict: bool

If true apply strict validation. Defaults to True.

validate: bool

If true validate the message. Defaults to True.

sep: bytes

The field separator. Defaults to SOH.

convert_sep_for_checksum: bool

If true convert the separator before calculating the checksum. Defaults to True.

Returns

FixMessage: A class containing the decoded message.

method FixMessage.encode

Summary

Encode the message into the FIX bytes buffer

FixMessage.encode(
sep: bytes,
regenerate_integrity: bool,
convert_sep_for_checksum: bool
) -> bytes

Parameters

sep: bytes

The field separator. Defaults to SOH.

regenerate_integrity: bool

If true regenerate the integrity of the message by creating the begin string, body length, and checksum. Defaults to True.

convert_sep_for_checksum: bool

If true convert the field separator before calculating the checksum. Defaults to False.

Returns

bytes: The FIX bytes buffer.

class FixMessageFactory

Summary

Initialise the message factory

jetblack_fixparser.fix_message.FixMessageFactory(
sender_comp_id: str,
target_comp_id: str,
*,
strict: bool,
validate: bool,
sep: bytes,
convert_sep_for_checksum: bool,
header_kwargs: Optional[Mapping[str, Any]]
) -> None

Parameters

sender_comp_id: str (optional)

The sender comp id.

target_comp_id: str (optional)

The target comp id.

strict: bool

If true use strict validation. Defaults to True.

validate: bool

If true validate the message. Defaults to True.

sep: bytes

The field separator to use. Defaults to SOH.

convert_sep_for_checksum: bool

If true convert the field separator before calculating the checksum. Defaults to True.

header_kwargs: Optional[Mapping[str, Any]]

Extra header args. Defaults to None.

method FixMessageFactory.create

Summary

Create a FIX message

FixMessageFactory.create(
msg_type: str,
msg_seq_num: int,
sending_time: datetime,
body_kwargs: Optional[Mapping[str, Any]],
header_kwargs: Optional[Mapping[str, Any]],
trailer_kwargs: Optional[Mapping[str, Any]]
) -> FixMessage

Parameters

msg_type: str (optional)

The message type.

msg_seq_num: int (optional)

The message sequence number.

sending_time: datetime (optional)

The sending time.

body_kwargs: Optional[Mapping[str, Any]]

The message body. Defaults to None.

header_kwargs: Optional[Mapping[str, Any]]

Extra header args. Defaults to None.

trailer_kwargs: Optional[Mapping[str, Any]]

Extra trailer args. Defaults to None.

Returns

FixMessage: The FIX message.

method FixMessageFactory.decode

Summary

Decode a FIX message byte buffer.

FixMessageFactory.decode(
buffer: bytes
) -> FixMessage

Parameters

buffer: bytes (optional)

The FIX bytes buffer

Returns

FixMessage: A decoded message.

class ValueType(Enum)

Summary

Value types

jetblack_fixparser.ValueType(
names: Any,
*,
module: Any,
qualname: Any,
type: Any,
start: Any
) -> None

Parameters

names: Any

module: Any

qualname: Any

type: Any

start: Any