findmyorder.handler.basic.BasicHandler#

class findmyorder.handler.basic.BasicHandler(**kwargs)[source]#

Bases: ParserClient

Initialize the Handler object

Methods

get_order(msg)

Get an order from a message.

identify_order(my_string)

Identify an order and return a dictionary with the order parameters

replace_instrument(order)

Replace instrument by an alternative instrument, if the instrument is not in the mapping, it will be ignored.

search(message)

Search an order.

async identify_order(my_string: str) dict[source]#

Identify an order and return a dictionary with the order parameters

Parameters:

my_string (str) – Message

Returns:

action, instrument

Return type:

dict with the order parameters

async get_order(msg: str)#

Get an order from a message. The message can be an order or an order identifier

Parameters:

msg (str) – Message

Returns:

dict

async replace_instrument(order)#

Replace instrument by an alternative instrument, if the instrument is not in the mapping, it will be ignored.

Parameters:

order (dict)

Returns:

dict

async search(message: str) bool#

Search an order.

Parameters:

message (str) – Message

Returns:

bool