22 lines
653 B
Python
22 lines
653 B
Python
import argparse
|
|
from typing import Dict, List
|
|
|
|
def get_instruments(args: argparse.Namespace, config: Dict) -> List[Dict[str, str]]:
|
|
|
|
instruments = [
|
|
{
|
|
"symbol": inst.split(":")[0],
|
|
"instrument_type": inst.split(":")[1],
|
|
"exchange_id": inst.split(":")[2],
|
|
"instrument_id_pfx": config["market_data_loading"][inst.split(":")[1]][
|
|
"instrument_id_pfx"
|
|
],
|
|
"db_table_name": config["market_data_loading"][inst.split(":")[1]][
|
|
"db_table_name"
|
|
],
|
|
}
|
|
for inst in args.instruments.split(",")
|
|
]
|
|
return instruments
|
|
|