goatools.nt_utils module

Utilities for combining namedtuples.

goatools.nt_utils.get_dict_w_id2nts(ids, id2nts, flds, dflt_null='')[source]

Return a new dict of namedtuples by combining “dicts” of namedtuples or objects.

goatools.nt_utils.get_list_w_id2nts(ids, id2nts, flds, dflt_null='')[source]

Return a new list of namedtuples by combining “dicts” of namedtuples or objects.

goatools.nt_utils.combine_nt_lists(lists, flds, dflt_null='')[source]

Return a new list of namedtuples by zipping “lists” of namedtuples or objects.

goatools.nt_utils.wr_py_nts(fout_py, nts, docstring=None, varname='nts')[source]

Save namedtuples into a Python module.

goatools.nt_utils.prt_nts(prt, nts, varname, spc='    ')[source]

Print namedtuples into a Python module.

goatools.nt_utils.get_unique_fields(fld_lists)[source]

Get unique namedtuple fields, despite potential duplicates in lists of fields.