Module trase.tools.pcs.traders.clean
Functions
def combine_traders_by_pattern(pattern, clean_name, dryrun=True, autocommit=True, cnx=None, cur=None)-
:param pattern: PostgreSQL-style pattern, e.g. 'TRADE%INC' :param clean_name: name of trader the labels matching "pattern" are merged into
def combine_traders_by_suffix(suffix_1, suffix_2, dryrun=True, autocommit=True, cnx=None, cur=None)-
Find traders that have the same name except for suffixes
suffix_1andsuffix_2. Ifdryrunis false, change trader of label suffix withsuffix_2to trader suffix withsuffix_1, except when trader suffix withsuffix_2has atrase_id, in which case label suffix withsuffix_1is moved to trader suffix withsuffix_2, except if trader suffix withsuffix_1also has atrase_id, in which case trader withsuffix_2is moved to group of trader withsuffix_1. def get_prefixes(end, cur=None)-
Return dictionary of {prefix: node_id} for all trader labels with name ending in
end