Skip to main content

Tool for parsing matrix files, extracting actions and processing them according to user defined logic

Project description

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" # path to matrix file or directory with matrices
filename_pattern: "*.matrix.csv" # matching pattern for files (can contain shell-style wildcards)

processed_actions: # which actions to process (action name to name of handler class)
  send: "TH2ActHandler"
  receive: "TH2Check1Handler"
  store: "TH2EstoreHandler"
  sleep: "SleepHandler"
  actSsh: "TH2ActSSHHandler"

field_mapping: # mapping for field renaming (old name to new name)
  TIF: "TimeInForce"

nested_fields: ["NoPartyIDs", "OrderQtyData", "Parties", "Instrument"] # which fields to convert to collections

fields_to_drop: # which fields to remove
  ["PreviousID", "Protocol", "CaseName", "Seq"]

fields_to_extract: # which fields to extract and keep as additional information
  ["Action", "MessageType", "Time", "User", "ID", "ExecutionAlias", "Direction", "Description"]

regenerate_id_fields: ["ClOrdID", "OrigClOrdID"] # ID-like fields to regenerate

regenerate_time_fields: ["TransactTime"] # Time-like fields to regenerate

processor_config: # processor config in free form
  th2_configs: "th2_configs" # path to directory with th2 configs
  root_event_name: 'run-one root event' # name of created root event
  book: "test_book" # book name
  scope: "test_script" # scope name
  use_place_method: False # use th2 act place methods (True) or plain send (False)
  key_fields: # mapping of key fields (message type to list of field names with support of nested fields) for th2-check1 request
    ExecutionReport:
      - "Side"
      - "ClOrdID"
      - "OrigClOrdID"
      - Instrument:
         - "Symbol"
  fail_unexpected: "NO" # rule of failing the validation for th2-check1 request if any unexpected field received
  ignore_fields: # mapping of fields (message type to list of field names) to be ignored in the th2-check1 rule validation
    ExecutionReport:
      - "header"
      - "trailer"
  sleep: 1 # delay between each action processing in seconds
  matrix_delay: 5 # delay between each matrix processing in seconds
  timestamp_shift: 1 # for how many seconds to the past make a shift for event timestamps

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

run_one-1.2.9.dev10609940276.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

run_one-1.2.9.dev10609940276-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file run_one-1.2.9.dev10609940276.tar.gz.

File metadata

File hashes

Hashes for run_one-1.2.9.dev10609940276.tar.gz
Algorithm Hash digest
SHA256 69182fdf3391d49c6d4933c9992a678d931f9dcdd33fee1e097560a4df5fde9f
MD5 d77662804bb3323b85cca483fdfe3d53
BLAKE2b-256 b3381d6db2bc84a8c4e5ad407d03cdc6856b355d198c77b1366b28e16e8b5c4d

See more details on using hashes here.

File details

Details for the file run_one-1.2.9.dev10609940276-py3-none-any.whl.

File metadata

File hashes

Hashes for run_one-1.2.9.dev10609940276-py3-none-any.whl
Algorithm Hash digest
SHA256 789aa1ebb3b843dead8c1ca7411ec3b4d1d000f0e266224237f17e4c2f995587
MD5 832bd82a70b5476d7aa9040790975e80
BLAKE2b-256 41e8a980f135de7d52d13c7d4448a6afcfb0e7dc920516f8dbcc9cbe458cddf1

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