Python 2.7 has reached end of support and will be deprecated on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7 applications, even if your organization previously used an organization policy to re-enable deployments of legacy runtimes. Your existing Python 2.7 applications will continue to run and receive traffic after their deprecation date. We recommend that you migrate to the latest supported version of Python.

google.appengine.ext.bulkload.csv_connector module

Summary

Bulkloader CSV reading and writing.

Handle the CSV format specified in a bulkloader.yaml file.

Contents

class google.appengine.ext.bulkload.csv_connector.CsvConnector(columns, column_list, skip_import_header_row, print_export_header_row, csv_encoding=None, import_options=None, export_options=None)source

Bases: google.appengine.ext.bulkload.connector_interface.ConnectorInterface

Read/write a (possibly encoded) CSV file.

classmethod create_from_options(options, name)source

Factory using an options dictionary.

Parameters
  • options –

    Dictionary of options: columns: ‘from_header’ or blank. column_list: overrides columns specifically. encoding: encoding of the file. e.g. ‘utf-8’ (default), ‘windows-1252’. skip_import_header_row: True to ignore the header line on import.

    Defaults False, except must be True if columns=from_header.

    print_export_header_row: True to print a header line on export.

    Defaults to False except if columns=from_header.

    import_options: Other kwargs to pass in, like "dialect". export_options: Other kwargs to pass in, like "dialect".

  • name – The name of this transformer, for use in error messages.

Returns

CsvConnector object described by the specified options.

Raises

InvalidConfiguration – If the config is invalid.

finalize_export()source
generate_import_record(filename, bulkload_state)source

Generator, yields dicts for nodes found as described in the options.

Parameters
  • filename – Filename to read.

  • bulkload_state – Passed bulkload_state.

Yields

Neutral dict, one per row in the CSV file.

initialize_export(filename, bulkload_state)source

Initialize the output file.

Parameters
  • filename – Filename to write.

  • bulkload_state – Passed bulkload_state.

write_dict(dictionary)source

Write one record for the specified entity.

class google.appengine.ext.bulkload.csv_connector.UnicodeDictWriter(stream, fieldnames, encoding='utf-8', **kwds)source

Bases: object

Based on UnicodeWriter in http://docs.python.org/library/csv.html.

writerow(row)source

Wrap writerow method.

google.appengine.ext.bulkload.csv_connector.utf8_recoder(stream, encoding)source

Generator that reads an encoded stream and reencodes to UTF-8.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年06月16日 UTC.