![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | generate_import_record |
def | initialize_export |
def | write_dict |
def | finalize_export |
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.
def google.appengine.ext.bulkload.connector_interface.ConnectorInterface.finalize_export | ( | self | ) |
Performs finalization actions after every record is written.
def google.appengine.ext.bulkload.connector_interface.ConnectorInterface.generate_import_record | ( | self, | |
filename, | |||
bulkload_state | |||
) |
A function which returns an iterator over dictionaries. This is the only method used on import. Args: 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. Returns: An iterator describing an individual record. Typically a dictionary, to be used with dict_to_model. Typically implemented as a generator.
def google.appengine.ext.bulkload.connector_interface.ConnectorInterface.initialize_export | ( | self, | |
filename, | |||
bulkload_state | |||
) |
Initialize the output file. Args: filename: The string given as the --filename flag argument. bulkload_state: Passed in BulkloadConfig.BulkloadState object. These values are opaque to the bulkloader and thus could specify any sort of descriptor for your exporter.
def google.appengine.ext.bulkload.connector_interface.ConnectorInterface.write_dict | ( | self, | |
dictionary | |||
) |
Write one record for the specified entity. Args: dictionary: A post-transform dictionary.