Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.utils.mdbtools

This is for writing fixtures that import data from an MS-Access database (.mdb) into Lino.

Usage examples see lino.projects.pcsw.fixtures.pp2lino and lino.projects.crl.fixtures.hs2lino.

It uses mdb-export to extract data from the .mdb file to .csv, then reads these csv files. mdb-export was written by Brian Bruns and is part of the mdbtools Debian package. To install it:

aptitude install mdbtools

Usage of mdbtools command line:

Usage: mdb-export [options] <file> <table>
where options are:
  -H             supress header row
  -Q             don't wrap text-like fields in quotes
  -d <delimiter> specify a column delimiter
  -R <delimiter> specify a row delimiter
  -I             INSERT statements (instead of CSV)
  -D <format>    set the date format (see strftime(3) for details)
  -S             Sanitize names (replace spaces etc. with underscore)
  -q <char>      Use <char> to wrap text-like fields. Default is ".
  -X <char>      Use <char> to escape quoted characters within a field. Default is doubling.

Thanks to http://farismadi.wordpress.com/2008/07/13/encoding-of-mdb-tool/ for explanations on the environment variables used by mdb-export.

The function check_output() in this module is a copy from Python 2.7 which we include here to make it usable in Python 2.6 too.

Classes

Loader()