dbf._io

Package dbf :: Module _io |
[hide private]

# Module _io

source code

Routines for saving, retrieving, and creating fields

Functions | [hide private]
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) called if a data type is not supported for that style of table | source code
retrieveCharacter(bytes, fielddef=`{``}`, memo=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) | 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) | source code
updateDouble(value, fielddef=`{``}`, memo=None) | source code
retrieveInteger(bytes, fielddef=`{``}`, memo=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) Returs 'T' if logical is True, 'F' otherwise | source code
retrieveMemo(bytes, fielddef, memo) 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) 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) 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
addCharacter(format) | source code
addDate(format) | source code
addLogical(format) | source code
addMemo(format) | source code
addNumeric(format) | source code
addVfpCurrency(format) | source code
addVfpDateTime(format) | source code
addVfpDouble(format) | source code
addVfpInteger(format) | source code
addVfpMemo(format) | source code
addVfpNumeric(format) | source code

Variables | [hide private]
| VFPTIME = `1721425`

Imports: struct, Decimal, DbfError, DataOverflow, Date, DateTime, Time, floor