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.connector_interface module
Summary
Bulkloader interfaces for the format reader/writers.
Contents
- class google.appengine.ext.bulkload.connector_interface.ConnectorInterfacesource
-
Bases: object
Abstract base class describing the external Connector interface.
The External Connector interface describes the transition between an external
data source, e.g. CSV file, XML file, or some sort of database interface, and
the intermediate bulkloader format, which is a dictionary or similar
structure representing the external transformation of the data.
On import, the generate_import_record generator is the only method called.
On export, the initialize_export method is called once, followed by a call
to write_dict for each record, followed by a call to finalize_export.
The bulkload_state is a BulkloadState object from
google.appengine.ext.bulkload.bulkload_config. The interesting properties
to a Connector object are the loader_opts and exporter_opts, which are strings
passed in from the bulkloader command line.
- finalize_export()source
-
Performs finalization actions after every record is written.
- generate_import_record(filename, bulkload_state)source
A function which returns an iterator over dictionaries.
This is the only method used on import.
Parameters
-
filename – The –filename argument passed in on the bulkloader command
line. This value is opaque to the bulkloader and thus could specify
any sort of descriptor for your generator.
-
bulkload_state – Passed in BulkloadConfig.BulkloadState object.
ReturnsAn iterator describing an individual record. Typically a dictionary,
to be used with dict_to_model. Typically implemented as a generator.
- initialize_export(filename, bulkload_state)source
Initialize the output file.
ParametersThese values are opaque to the bulkloader and thus could specify
any sort of descriptor for your exporter.
- write_dict(dictionary)source
Write one record for the specified entity.
Parametersdictionary – A post-transform dictionary.
- google.appengine.ext.bulkload.connector_interface.create_from_options(options, name='unknown')source
Factory using an options dictionary.
This is frequently implemented as the constructor on the connector class,
or a static or class method on the connector class.
Parameters
-
options – Parsed dictionary from yaml file, interpretation is up to the
implementor of this class.
-
name – Identifier of this transform to be used in error messages.
ReturnsAn object which implements the ConnectorInterface interface.
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\u003eConnectorInterface\u003c/code\u003e class serves as an abstract base for bridging external data sources with the bulkloader's internal format, facilitating data import and export.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egenerate_import_record\u003c/code\u003e method, called during import, provides an iterator over dictionaries, each representing a single record.\u003c/p\u003e\n"],["\u003cp\u003eDuring export, \u003ccode\u003einitialize_export\u003c/code\u003e is called first, followed by \u003ccode\u003ewrite_dict\u003c/code\u003e for each record, and finally \u003ccode\u003efinalize_export\u003c/code\u003e to perform cleanup actions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecreate_from_options\u003c/code\u003e function acts as a factory to create \u003ccode\u003eConnectorInterface\u003c/code\u003e objects based on a parsed dictionary of options.\u003c/p\u003e\n"]]],[],null,["# google.appengine.ext.bulkload.connector_interface module\n========================================================\n\nSummary\n-------\n\nBulkloader interfaces for the format reader/writers.\n\nContents\n--------\n\n*class* google.appengine.ext.bulkload.connector_interface.ConnectorInterface[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/connector_interface#ConnectorInterface)\n\n: Bases: object\n\n Abstract base class describing the external Connector interface.\n\n The External Connector interface describes the transition between an external\n data source, e.g. CSV file, XML file, or some sort of database interface, and\n the intermediate bulkloader format, which is a dictionary or similar\n structure representing the external transformation of the data.\n\n On import, the generate_import_record generator is the only method called.\n\n On export, the initialize_export method is called once, followed by a call\n to write_dict for each record, followed by a call to finalize_export.\n\n The bulkload_state is a BulkloadState object from\n google.appengine.ext.bulkload.bulkload_config. The interesting properties\n to a Connector object are the loader_opts and exporter_opts, which are strings\n passed in from the bulkloader command line. \n\n finalize_export()[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/connector_interface#ConnectorInterface.finalize_export)\n\n : Performs finalization actions after every record is written.\n\n generate_import_record(filename, bulkload_state)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/connector_interface#ConnectorInterface.generate_import_record)\n\n : A function which returns an iterator over dictionaries.\n\n This is the only method used on import.\n Parameters\n\n - filename -- The --filename argument passed in on the bulkloader command\n line. This value is opaque to the bulkloader and thus could specify\n any sort of descriptor for your generator.\n\n - bulkload_state -- Passed in BulkloadConfig.BulkloadState object.\n\n Returns\n\n An iterator describing an individual record. Typically a dictionary,\n to be used with dict_to_model. Typically implemented as a generator. \n\n initialize_export(filename, bulkload_state)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/connector_interface#ConnectorInterface.initialize_export)\n\n : Initialize the output file.\n\n Parameters\n\n - filename -- The string given as the --filename flag argument.\n\n - bulkload_state -- Passed in BulkloadConfig.BulkloadState object.\n\n These values are opaque to the bulkloader and thus could specify\n any sort of descriptor for your exporter. \n\n write_dict(dictionary)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/connector_interface#ConnectorInterface.write_dict)\n\n : Write one record for the specified entity.\n\n Parameters\n\ndictionary -- A post-transform dictionary. \n\ngoogle.appengine.ext.bulkload.connector_interface.create_from_options(options, name='unknown')[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/ext/bulkload/connector_interface#create_from_options)\n\n: Factory using an options dictionary.\n\n This is frequently implemented as the constructor on the connector class,\n or a static or class method on the connector class.\n Parameters\n\n - options -- Parsed dictionary from yaml file, interpretation is up to the\n implementor of this class.\n\n - name -- Identifier of this transform to be used in error messages.\n\n Returns\n\n An object which implements the ConnectorInterface interface."]]