Module trase.tools.pcs.dataset_traders

Functions

def create_traders_hierarchy(data, autocommit=True, cnx=None, cur=None)

Return traders hierarchy using external data instead of the database.

Example of data:

data = [
    {"label": "BUNGE IBERICA SA", "trader": "BUNGE IBERICA", "group": "BUNGE"},
    {"label": "ADM DO BRASIL LTDA", "trader": "ADM DO BRASIL"},
    {"trader": "CARGILL AGRICOLA SA", "group": "CARGILL"},
]
def get_dataset_traders_hierarchy(ref_id, cur=None)
def get_db_traders_hierarchy(label_ids, trader_ids, cur=None)

Return the traders hierarchy from the database for all provided labels.