Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.
Stay organized with collections Save and categorize content based on your preferences.

google.appengine.ext.bulkload.simpletext_connector module

Summary

Bulkloader Simple Text writing.

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

Contents

class google.appengine.ext.bulkload.simpletext_connector.SimpleTextConnector(template, prolog=None, epilog=None, mode='text', name='')source

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

Write a text file from dicts for each record. Does not support import.

VALID_MODES = ('text', 'nonewline', 'binary')
classmethod create_from_options(options, name)source

Factory using an options dictionary.

Parameters
  • options –

    Dictionary of options containing: template: A Python dict-interpolation string. Required. prolog: written before the per-record output. epilog: written after the per-record output. mode: one of the following, default is ‘text’

    text: text file mode, newlines between records. nonewline: text file mode, no added newlines. binary: binary file mode, no added newlines.

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

Returns

SimpleTextConnector object described by the specified options.

Raises

InvalidConfiguration – If the config is invalid.

finalize_export()source

Write epliog and close file after every record is written.

initialize_export(filename, bulkload_state)source

Open file and write prolog.

write_dict(dictionary)source

Write one record for the specified entity.