CSV2DB.py - utilities for uploading a table to database

Author:Andreas Heger
Release:$Id$
Date:December 09, 2013
Tags:Python

Purpose

create a table from a csv separated file and load data into it.

This module supports backends for postgres and sqlite3. Column types are auto-detected.

Todo

Use file import where appropriate to speed up loading. Currently, this is not always the case.

Usage

Documentation

Code

CSV2DB.executewait(dbhandle, statement, error, retry=False, wait=5)

execute sql statement.

Retry on error, if retry is True. Returns a cursor object.

CSV2DB.quoteRow(row, take, map_column2type, missing_values, null='NULL', string_value='%s')

return a dictionary with properly quoted values.

Table Of Contents

Previous topic

<no title>

Next topic

<no title>

This Page