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.
Stay organized with collections
Save and categorize content based on your preferences.
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.
ReturnsCsvConnector object described by the specified options.
RaisesInvalidConfiguration – If the config is invalid.
- generate_import_record(filename, bulkload_state)source
Generator, yields dicts for nodes found as described in the options.
ParametersYieldsNeutral dict, one per row in the CSV file.
- initialize_export(filename, bulkload_state)source
Initialize the output file.
Parameters
- write_dict(dictionary)source
-
Write one record for the specified entity.
- 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egoogle.appengine.ext.bulkload.csv_connector\u003c/code\u003e module provides functionality for reading and writing CSV files in the format specified by a bulkloader.yaml file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCsvConnector\u003c/code\u003e class handles the reading and writing of CSV files, offering options for customization like column handling, encoding, and header rows, and it also uses a factory method for easy configuration via an options dictionary.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egenerate_import_record\u003c/code\u003e method of the \u003ccode\u003eCsvConnector\u003c/code\u003e class yields dictionaries representing rows from the CSV file during the import process, and it is configured to use a file and bulkload state as parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUnicodeDictWriter\u003c/code\u003e class, derived from the standard CSV module, supports writing Unicode data to CSV files, including the necessary encoding, and has a \u003ccode\u003ewriterow\u003c/code\u003e method for writing rows.\u003c/p\u003e\n"],["\u003cp\u003eThe module features a \u003ccode\u003eutf8_recoder\u003c/code\u003e function that acts as a generator, reading from an encoded stream and re-encoding the content to UTF-8.\u003c/p\u003e\n"]]],[],null,["# google.appengine.ext.bulkload.csv_connector module\n==================================================\n\nSummary\n-------\n\nBulkloader CSV reading and writing.\n\nHandle the CSV format specified in a bulkloader.yaml file.\n\nContents\n--------\n\n*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](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#CsvConnector)\n\n: Bases: [google.appengine.ext.bulkload.connector_interface.ConnectorInterface](/appengine/docs/legacy/standard/python/refdocs/google.appengine.ext.bulkload.connector_interface#google.appengine.ext.bulkload.connector_interface.ConnectorInterface)\n\n Read/write a (possibly encoded) CSV file. \n\n *classmethod* create_from_options(options, name)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#CsvConnector.create_from_options)\n\n : Factory using an options dictionary.\n\n Parameters\n\n - options --\n\n Dictionary of options:\n columns: 'from_header' or blank.\n column_list: overrides columns specifically.\n encoding: encoding of the file. e.g. 'utf-8' (default), 'windows-1252'.\n skip_import_header_row: True to ignore the header line on import.\n\n Defaults False, except must be True if columns=from_header.\n\n print_export_header_row: True to print a header line on export.\n\n : Defaults to False except if columns=from_header.\n\n import_options: Other kwargs to pass in, like \"dialect\".\n export_options: Other kwargs to pass in, like \"dialect\".\n\n \u003cbr /\u003e\n\n - name -- The name of this transformer, for use in error messages.\n\n Returns\n\n CsvConnector object described by the specified options.\n Raises\n\n InvalidConfiguration -- If the config is invalid. \n\n finalize_export()[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#CsvConnector.finalize_export)\n : \n\n generate_import_record(filename, bulkload_state)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#CsvConnector.generate_import_record)\n\n : Generator, yields dicts for nodes found as described in the options.\n\n Parameters\n\n - filename -- Filename to read.\n\n - bulkload_state -- Passed bulkload_state.\n\n Yields\n\n Neutral dict, one per row in the CSV file. \n\n initialize_export(filename, bulkload_state)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#CsvConnector.initialize_export)\n\n : Initialize the output file.\n\n Parameters\n\n - filename -- Filename to write.\n\n - bulkload_state -- Passed bulkload_state.\n\n write_dict(dictionary)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#CsvConnector.write_dict)\n\n : Write one record for the specified entity.\n\n*class* google.appengine.ext.bulkload.csv_connector.UnicodeDictWriter(stream, fieldnames, encoding='utf-8', \\*\\*kwds)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#UnicodeDictWriter)\n\n: Bases: object\n\n Based on UnicodeWriter in \u003chttp://docs.python.org/library/csv.html\u003e. \n\n writerow(row)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#UnicodeDictWriter.writerow)\n\n : Wrap writerow method.\n\ngoogle.appengine.ext.bulkload.csv_connector.utf8_recoder(stream, encoding)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/csv_connector#utf8_recoder)\n\n: Generator that reads an encoded stream and reencodes to UTF-8."]]