def package_search_table(search_results):

    fields = OrderedDict([
        ('NAME', lambda p: p['name']),
        ('VERSION', lambda p: p['currentVersion']),
        ('SELECTED', lambda p: p.get("selected", False)),
        ('FRAMEWORK', lambda p: p['framework']),
        ('DESCRIPTION', lambda p: p['description'])
    ])

    packages = []
    for package in search_results['packages']:
        package_ = copy.deepcopy(package)
        packages.append(package_)

    tb = table(fields, packages, sortby="NAME")
    tb.align['NAME'] = 'l'
    tb.align['VERSION'] = 'l'
    tb.align['SELECTED'] = 'l'
    tb.align['FRAMEWORK'] = 'l'
    tb.align['DESCRIPTION'] = 'l'

    return tb
Returns a PrettyTable representation of the provided DCOS package
dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/tables.py/package_search_table