fixml.cli.utils

Functions

parse_list(→ tuple)

Parse input into list.

Module Contents

fixml.cli.utils.parse_list(raw_input: Any, delim: str = ',') tuple

Parse input into list.

Given any input, this function will try its best to convert it into a list, while preventing doing character splitting on a string.

For example, python-fire will parse input like “1bc,30” as a string, but parse inputs such as “10,40” and “abc,bcd” as list.

This function makes sure that all inputs would be normalized into a tuple before further processing.

Parameters:
  • raw_input (Any) – The input passed on by python-fire.

  • delim (str, optional) – Delimiter to split the input into when the input is string. Defaults to ‘,’.

Returns:

The converted input as tuple.

Return type:

tuple