Package dbf :: Module tables
[hide private]

Module tables

source code

table definitions

Classes [hide private]
  property
Emulate PyProperty_Type() in Objects/descrobject.c
  _DbfRecord
Provides routines to extract and save data within the fields of a dbf record.
  _DbfMemo
Provides access to memo fields as dictionaries must override _init, _get_memo, and _put_memo to store memo contents to disk
  _Db3Memo
Provides access to memo fields as dictionaries must override _init, _get_memo, and _put_memo to store memo contents to disk
  _VfpMemo
Provides access to memo fields as dictionaries must override _init, _get_memo, and _put_memo to store memo contents to disk
  DbfTable
Provides a framework for dbf style tables.
  Db3Table
Provides an interface for working with dBase III tables.
  FpTable
Provides an interface for working with FoxPro 2 tables
  VfpTable
Provides an interface for working with Visual FoxPro 6 tables
  List
list of Dbf records, with set-like behavior
  DbfCsv
csv format for exporting tables
  Index
  _Db4Table
Functions [hide private]
 
sql_select(records, chosen_fields, condition, field_names) source code
 
sql_update(records, command, condition, field_names) source code
 
sql_delete(records, dead_fields, condition, field_names) source code
 
sql_recall(records, all_fields, condition, field_names) source code
 
sql_add(records, new_fields, condition, field_names) source code
 
sql_drop(records, dead_fields, condition, field_names) source code
 
sql_pack(records, command, condition, field_names) source code
 
sql_resize(records, fieldname_newsize, condition, field_names) source code
 
sql_criteria(records, criteria)
creates a function matching the sql criteria
source code
 
sql_cmd(command, field_names)
creates a function matching to apply command to each record in records
source code
 
sql(records, command)
recognized sql commands are SELECT, UPDATE | REPLACE, DELETE, RECALL, ADD, DROP
source code
 
_nop(value)
returns parameter unchanged
source code
 
_normalize_tuples(tuples, length, filler)
ensures each tuple is the same length, using filler[-missing] for the gaps
source code
 
_codepage_lookup(cp) source code
 
ascii(new_setting=None)
get/set return_ascii setting
source code
 
codepage(cp=None)
get/set default codepage for any new tables
source code
 
encoding(cp=None)
get/set default encoding for non-unicode strings passed into a table
source code
Variables [hide private]
  input_decoding = 'cp1252'
  default_codepage = 'cp1252'
  return_ascii = False
  temp_dir = 'c:\\Temp'
  version_map = {'\x02': 'FoxBASE', '\x03': 'dBase III Plus', '\...
  code_pages = {'\x00': ('ascii', 'plain ol\' ascii'), '\x01': (...
  sql_functions = {'select': sql_select, 'update': sql_update, '...

Imports: os, sys, csv, codecs, locale, unicodedata, weakref, array, bisect_left, bisect_right, Decimal, copyfileobj, dbf, io, Date, DateTime, Time, Bof, Eof, DbfError, DataOverflow, FieldMissing, NonUnicode, DoNotIndex


Variables Details [hide private]

version_map

Value:
{'\x02': 'FoxBASE',
 '\x03': 'dBase III Plus',
 '\x04': 'dBase IV',
 '\x05': 'dBase V',
 '0': 'Visual FoxPro',
 '1': 'Visual FoxPro (auto increment field)',
 'C': 'dBase IV SQL',
 '{': 'dBase IV w/memos',
...

code_pages

Value:
{'\x00': ('ascii', 'plain ol\' ascii'),
 '\x01': ('cp437', 'U.S. MS-DOS'),
 '\x02': ('cp850', 'International MS-DOS'),
 '\x03': ('cp1252', 'Windows ANSI'),
 '\x04': ('mac_roman', 'Standard Macintosh'),
 '\x08': ('cp865', 'Danish OEM'),
 '\t': ('cp437', 'Dutch OEM'),
 '''
...

sql_functions

Value:
{'select': sql_select, 'update': sql_update, 'replace': sql_update, 'i\
nsert': None, 'delete': sql_delete, 'recall': sql_recall, 'add': sql_a\
dd, 'drop': sql_drop, 'count': None, 'pack': sql_pack, 'resize': sql_r\
esize,}