|
packShortInt(value,
bigendian=False)
Returns a two-bye integer from the value, or raises DbfError |
source code
|
|
|
packLongInt(value,
bigendian=False)
Returns a four-bye integer from the value, or raises DbfError |
source code
|
|
|
packDate(date)
Returns a group of three bytes, in integer form, of the date |
source code
|
|
|
packStr(string)
Returns an 11 byte, upper-cased, null padded string suitable for
field names; raises DbfError if the string is bigger than 10 bytes |
source code
|
|
|
unpackShortInt(bytes,
bigendian=False)
Returns the value in the two-byte integer passed in |
source code
|
|
|
unpackLongInt(bytes,
bigendian=False)
Returns the value in the four-byte integer passed in |
source code
|
|
|
unpackDate(bytestr)
Returns a Date() of the packed three-byte date passed in |
source code
|
|
|
unpackStr(chars)
Returns a normal, lower-cased string from a null-padded byte string |
source code
|
|
|
convertToBool(value)
Returns boolean true or false; normal rules apply to non-string
values; string values must be 'y','t', 'yes', or 'true' (case
insensitive) to be True |
source code
|
|
|
unsupportedType(something,
field,
memo=None,
typ=None)
called if a data type is not supported for that style of table |
source code
|
|
|
retrieveCharacter(bytes,
fielddef={ } ,
memo=None,
typ=None)
Returns the string in bytes with trailing white space removed |
source code
|
|
|
updateCharacter(string,
fielddef,
memo=None)
returns the string, truncating if string is longer than it's field |
source code
|
|
|
retrieveCurrency(bytes,
fielddef={ } ,
memo=None,
typ=None) |
source code
|
|
|
updateCurrency(value,
fielddef={ } ,
memo=None) |
source code
|
|
|
retrieveDate(bytes,
fielddef={ } ,
memo=None)
Returns the ascii coded date as a Date object |
source code
|
|
|
updateDate(moment,
fielddef={ } ,
memo=None)
returns the Date or datetime.date object ascii-encoded (yyyymmdd) |
source code
|
|
|
retrieveDouble(bytes,
fielddef={ } ,
memo=None,
typ=None) |
source code
|
|
|
updateDouble(value,
fielddef={ } ,
memo=None) |
source code
|
|
|
retrieveInteger(bytes,
fielddef={ } ,
memo=None,
typ=None)
Returns the binary number stored in bytes in little-endian format |
source code
|
|
|
updateInteger(value,
fielddef={ } ,
memo=None)
returns value in little-endian binary format |
source code
|
|
|
retrieveLogical(bytes,
fielddef={ } ,
memo=None)
Returns True if bytes is 't', 'T', 'y', or 'Y', None if '?', and
False otherwise |
source code
|
|
|
updateLogical(logical,
fielddef={ } ,
memo=None)
Returns 'T' if logical is True, 'F' otherwise |
source code
|
|
|
retrieveMemo(bytes,
fielddef,
memo,
typ)
Returns the block of data from a memo file |
source code
|
|
|
updateMemo(string,
fielddef,
memo)
Writes string as a memo, returns the block number it was saved into |
source code
|
|
|
retrieveNumeric(bytes,
fielddef,
memo=None,
typ=None)
Returns the number stored in bytes as integer if field spec for
decimals is 0, float otherwise |
source code
|
|
|
updateNumeric(value,
fielddef,
memo=None)
returns value as ascii representation, rounding decimal portion as
necessary |
source code
|
|
|
retrieveVfpDateTime(bytes,
fielddef={ } ,
memo=None)
returns the date/time stored in bytes; dates <= 01/01/1981
00:00:00 may not be accurate; BC dates are nulled. |
source code
|
|
|
updateVfpDateTime(moment,
fielddef={ } ,
memo=None)
sets the date/time stored in moment moment must have fields year,
month, day, hour, minute, second, microsecond |
source code
|
|
|
retrieveVfpMemo(bytes,
fielddef,
memo,
typ=None)
Returns the block of data from a memo file |
source code
|
|
|
updateVfpMemo(string,
fielddef,
memo)
Writes string as a memo, returns the block number it was saved into |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
_normalize_tuples(tuples,
length,
filler)
ensures each tuple is the same length, using filler[-missing] for the
gaps |
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
|
|
|
Table(filename,
field_specs='
' ,
memo_size=128,
ignore_memos=False,
read_only=False,
keep_memos=False,
meta_only=False,
dbf_type=None,
codepage=None,
numbers=' default ' ,
strings=<type 'str'>,
currency=<class 'decimal.Decimal'>)
returns an open table of the correct dbf_type, or creates it if
field_specs is given |
source code
|
|
|
index(sequence)
returns integers 0 - len(sequence) |
source code
|
|
|
|
|
table_type(filename)
returns text representation of a table's dbf version |
source code
|
|
|
add_fields(table_name,
field_specs)
adds fields to an existing table |
source code
|
|
|
delete_fields(table_name,
field_names)
deletes fields from an existing table |
source code
|
|
|
export(table_name,
filename='
' ,
fields='
' ,
format=' csv ' ,
header=True)
creates a csv or tab-delimited file from an existing table |
source code
|
|
|
first_record(table_name)
prints the first record of a table |
source code
|
|
|
from_csv(csvfile,
to_disk=False,
filename=None,
field_names=None,
extra_fields=None,
dbf_type=' db3 ' ,
memo_size=64,
min_field_size=1)
creates a Character table from a csv file to_disk will create a table
with the same name filename will be used if provided field_names
default to f0, f1, f2, etc, unless specified (list) extra_fields can
be used to add additional fields -- should be normal field specifiers
(list) |
source code
|
|
|
get_fields(table_name)
returns the list of field names of a table |
source code
|
|
|
|
|
rename_field(table_name,
oldfield,
newfield)
renames a field in a table |
source code
|
|
|
structure(table_name,
field=None)
returns the definition of a field (or all fields) |
source code
|
|
|
|