run-one
Tool for parsing matrix files, extracting actions and processing them according to user defined logic
How to setup environment and install dependencies
python -m venv $VENV_PATH
$VENV_PATH/bin/pip install -U pip setuptools
$VENV_PATH/bin/pip install poetry
$VENV_PATH/bin/poetry install -E th2
Note: -E th2
is optional and can be omitted if you don't need th2-related dependencies.
Config example (using th2 processor)
matrix_path: "matrix_case.csv"
filename_pattern: "*.matrix.csv"
processed_actions:
send: "TH2ActHandler"
receive: "TH2Check1Handler"
store: "TH2EstoreHandler"
sleep: "SleepHandler"
actSsh: "TH2ActSSHHandler"
field_mapping:
TIF: "TimeInForce"
nested_fields: ["NoPartyIDs", "OrderQtyData", "Parties", "Instrument"]
fields_to_drop:
["PreviousID", "Protocol", "CaseName", "Seq"]
fields_to_extract:
["Action", "MessageType", "Time", "User", "ID", "ExecutionAlias", "Direction", "Description"]
regenerate_id_fields: ["ClOrdID", "OrigClOrdID"]
regenerate_time_fields: ["TransactTime"]
processor_config:
th2_configs: "th2_configs"
root_event_name: 'run-one root event'
book: "test_book"
scope: "test_script"
use_place_method: False
key_fields:
ExecutionReport:
- "Side"
- "ClOrdID"
- "OrigClOrdID"
- Instrument:
- "Symbol"
fail_unexpected: "NO"
ignore_fields:
ExecutionReport:
- "header"
- "trailer"
sleep: 1
matrix_delay: 5
timestamp_shift: 1