App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.ext.bulkload.csv_connector.CsvConnector Class Reference
Inheritance diagram for google.appengine.ext.bulkload.csv_connector.CsvConnector:
google.appengine.ext.bulkload.connector_interface.ConnectorInterface

Public Member Functions

def create_from_options
 
def __init__
 
def generate_import_record
 
def initialize_export
 
def write_dict
 
def finalize_export
 
- Public Member Functions inherited from google.appengine.ext.bulkload.connector_interface.ConnectorInterface
def generate_import_record
 
def initialize_export
 
def write_dict
 
def finalize_export
 

Public Attributes

 columns
 
 from_header
 
 column_list
 
 skip_import_header_row
 
 print_export_header_row
 
 csv_encoding
 
 dict_generator
 
 output_stream
 
 csv_writer
 
 bulkload_state
 
 import_options
 
 export_options
 

Detailed Description

Read/write a (possibly encoded) CSV file.

Constructor & Destructor Documentation

def google.appengine.ext.bulkload.csv_connector.CsvConnector.__init__ (   self,
  columns,
  column_list,
  skip_import_header_row,
  print_export_header_row,
  csv_encoding = None,
  import_options = None,
  export_options = None 
)
Initializer.

Args:
  columns: 'from_header' or blank
  column_list: overrides columns specifically.
  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.
  csv_encoding: encoding of the file.
  import_options: Other kwargs to pass in, like "dialect".
  export_options: Other kwargs to pass in, like "dialect".

Member Function Documentation

def google.appengine.ext.bulkload.csv_connector.CsvConnector.create_from_options (   cls,
  options,
  name 
)
Factory using an options dictionary.

Args:
  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.
def google.appengine.ext.bulkload.csv_connector.CsvConnector.generate_import_record (   self,
  filename,
  bulkload_state 
)
Generator, yields dicts for nodes found as described in the options.

Args:
  filename: Filename to read.
  bulkload_state: Passed bulkload_state.

Yields:
  Neutral dict, one per row in the CSV file.
def google.appengine.ext.bulkload.csv_connector.CsvConnector.initialize_export (   self,
  filename,
  bulkload_state 
)
Initialize the output file.

Args:
  filename: Filename to write.
  bulkload_state: Passed bulkload_state.
def google.appengine.ext.bulkload.csv_connector.CsvConnector.write_dict (   self,
  dictionary 
)
Write one record for the specified entity.

The documentation for this class was generated from the following file: