How to use the unicodecsv.UnicodeWriter function in unicodecsv

To help you get started, we’ve selected a few unicodecsv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nexB / conan / src / conan / installed_rpms.py View on Github external
queried.

    An RPM version is  listed only in the layer where it is first installed (or first updated).

    Results are printed to stdout as CSV with these columns:

    image_id,image_name,image_tag,layer_id,layer_order,layer_command,installed_rpm_file

    Note that if a layer does not contain RPMs or is not for an RPM-based distro the results may be empty.

    The rows are repeated for each RPM found.
    Output is printed to stdout. Use a ">" redirect to save in a file.
    """
    headers = 'image_id image_name image_tag layer_id layer_order layer_command installed_rpm_file'.split()
    data = installed_rpms_by_image_layer(image_id)
    w = unicodecsv.UnicodeWriter(sys.stdout, encoding='utf-8')
    w.writerow(headers)
    w.writerows(data)