Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Enum
adds 'export_to()' function
|
|
IntEnum
|
|
HexEnum
repr is in hex
|
|
ValueAliasEnum
allows value aliases (not name aliases)
|
|
AutoEnum
Automatically numbers enum members starting from __number__ (defaults
to 0).
|
|
IsoDay
|
|
RelativeDay
|
|
IsoMonth
|
|
RelativeMonth
|
|
LatinByte
|
|
FieldType
|
|
FieldFlag
|
|
Field
|
|
DbfLocation
|
|
DbfStatus
|
|
LazyAttr
doesn't create object until actually accessed
|
|
MutableDefault
Lives in the class, and on first access calls the supplied factory
and maps the result into the instance it was called on
|
|
DbfError
Fatal errors elicit this response.
|
|
DataOverflowError
Data too large for field
|
|
BadDataError
bad data in table
|
|
FieldMissingError
Field does not exist in table
|
|
FieldSpecError
invalid field specification
|
|
NonUnicodeError
Data for table not in unicode
|
|
NotFoundError
record criteria not met
|
|
DbfWarning
Normal operations elicit this response
|
|
Eof
End of file reached
|
|
Bof
Beginning of file reached
|
|
DoNotIndex
Returned by indexing functions to suppress a record from becoming
part of the index
|
|
NullType
Null object -- any interaction returns Null
|
|
Char
Strips trailing whitespace, and ignores trailing whitespace for
comparisons
|
|
baseinteger
int(x=0) -> int or long int(x, base=10) -> int or long
|
|
Date
adds null capable datetime.date constructs
|
|
DateTime
adds null capable datetime.datetime constructs
|
|
Time
adds null capable datetime.time constructs
|
|
Period
for matching various time ranges
|
|
Logical
Logical field return type.
|
|
Quantum
Logical field return type that implements boolean algebra
|
|
_Navigation
Navigation base class that provides VPFish movement methods
|
|
Record
Provides routines to extract and save data within the fields of a
dbf record.
|
|
RecordTemplate
Provides routines to mimic a dbf record.
|
|
RecordVaporWare
Provides routines to mimic a dbf record, but all values are
non-existent.
|
|
_DbfMemo
Provides access to memo fields as dictionaries Must override _init,
_get_memo, and _put_memo to store memo contents to disk
|
|
_Db3Memo
dBase III specific
|
|
_VfpMemo
Visual Foxpro 6 specific
|
|
DbfCsv
csv format for exporting tables
|
|
Tables
context manager for multiple tables and/or indices
|
|
IndexLocation
Represents the index where the match criteria is if True, or would
be if False
|
|
FieldInfo
tuple with named attributes for representing a field's dbf type,
length, decimal portion, and python class
|
|
CodePage
tuple with named attributes for representing a tables codepage
|
|
Iter
Provides iterable behavior for a table
|
|
Table
Base class for dbf style tables
|
|
Db3Table
Provides an interface for working with dBase III tables.
|
|
ClpTable
Provides an interface for working with Clipper 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
|
|
Index
non-persistent index for a table
|
|
Relation
establishes a relation between two dbf tables (not persistent)
|
|
IndexFile
|
|
_Db4Table
under development
|
|
|
|
none(*args,
**kwargs)
because we can't do `NoneType(*args, **kwargs)` |
source code
|
|
|
pack_short_int(value,
bigendian=False)
Returns a two-bye integer from the value, or raises DbfError |
source code
|
|
|
pack_long_int(value,
bigendian=False)
Returns a four-bye integer from the value, or raises DbfError |
source code
|
|
|
pack_str(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
|
|
|
unpack_short_int(bytes,
bigendian=False)
Returns the value in the two-byte integer passed in |
source code
|
|
|
unpack_long_int(bytes,
bigendian=False)
Returns the value in the four-byte integer passed in |
source code
|
|
|
unpack_str(chars)
Returns a normal, lower-cased string from a null-padded byte string |
source code
|
|
|
scinot(value,
decimals)
return scientific notation with not more than decimals-1 decimal
places |
source code
|
|
|
unsupported_type(something,
*ignore)
called if a data type is not supported for that style of table |
source code
|
|
|
retrieve_character(bytes,
fielddef,
memo,
decoder)
Returns the string in bytes as fielddef[CLASS] or fielddef[EMPTY] |
source code
|
|
|
update_character(string,
fielddef,
memo,
decoder,
encoder)
returns the string as bytes (not unicode) as fielddef[CLASS] or
fielddef[EMPTY] |
source code
|
|
|
retrieve_currency(bytes,
fielddef,
*ignore)
Returns the currency value in bytes |
source code
|
|
|
update_currency(value,
*ignore)
Returns the value to be stored in the record's disk data |
source code
|
|
|
retrieve_date(bytes,
fielddef,
*ignore)
Returns the ascii coded date as fielddef[CLASS] or fielddef[EMPTY] |
source code
|
|
|
update_date(moment,
*ignore)
Returns the Date or datetime.date object ascii-encoded (yyyymmdd) |
source code
|
|
|
retrieve_double(bytes,
fielddef,
*ignore)
Returns the double in bytes as fielddef[CLASS] ('default' == float) |
source code
|
|
|
update_double(value,
*ignore)
returns the value to be stored in the record's disk data |
source code
|
|
|
retrieve_integer(bytes,
fielddef,
*ignore)
Returns the binary number stored in bytes in little-endian format as
fielddef[CLASS] |
source code
|
|
|
update_integer(value,
*ignore)
Returns value in little-endian binary format |
source code
|
|
|
retrieve_logical(bytes,
fielddef,
*ignore)
Returns True if bytes is 't', 'T', 'y', or 'Y' None if '?' False
otherwise |
source code
|
|
|
update_logical(data,
*ignore)
Returns 'T' if logical is True, 'F' if False, '?' otherwise |
source code
|
|
|
retrieve_memo(bytes,
fielddef,
memo,
decoder)
Returns the block of data from a memo file |
source code
|
|
|
update_memo(string,
fielddef,
memo,
decoder,
encoder)
Writes string as a memo, returns the block number it was saved into |
source code
|
|
|
retrieve_numeric(bytes,
fielddef,
*ignore)
Returns the number stored in bytes as integer if field spec for
decimals is 0, float otherwise |
source code
|
|
|
update_numeric(value,
fielddef,
*ignore)
returns value as ascii representation, rounding decimal portion as
necessary |
source code
|
|
|
retrieve_vfp_datetime(bytes,
fielddef,
*ignore)
returns the date/time stored in bytes; dates <= 01/01/1981
00:00:00 may not be accurate; BC dates are nulled. |
source code
|
|
|
|
|
retrieve_vfp_memo(bytes,
fielddef,
memo,
decoder)
Returns the block of data from a memo file |
source code
|
|
|
update_vfp_memo(string,
fielddef,
memo,
decoder,
encoder)
Writes string as a memo, returns the block number it was saved into |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
field_spec_error_text(format,
flags)
generic routine for error text for the add...() functions |
source code
|
|
|
ezip(*iters)
extends all iters to longest one, using last value from each as
necessary |
source code
|
|
|
|
|
_normalize_tuples(tuples,
length,
filler)
ensures each tuple is the same length, using filler[-missing] for the
gaps |
source code
|
|
|
|
|
create_template(table_or_record,
defaults=None) |
source code
|
|
|
|
|
export(table_or_records,
filename=None,
field_names=None,
format='csv',
header=True,
dialect='dbf',
encoding=None)
writes the records using CSV or tab-delimited format, using the
filename given if specified, otherwise the table name if
table_or_records is a collection of records (not an actual table)
they should all be of the same format |
source code
|
|
|
field_names(thing)
fields in table/record, keys in dict |
source code
|
|
|
|
|
|
|
reset(record,
keep_fields=None)
sets record's fields back to original, except for fields in
keep_fields |
source code
|
|
|
source_table(thingie)
table associated with table | record | index |
source code
|
|
|
|
|
write(record,
**kwargs)
write record data to disk (updates indices) |
source code
|
|
|
Process(records,
start=0,
stop=None,
filter=None)
commits each record to disk before returning the next one; undoes all
changes to that record if exception raised if records is a table, it
will be opened and closed if necessary filter function should return
True to skip record, False to keep |
source code
|
|
|
Templates(records,
start=0,
stop=None,
filter=None)
returns a template of each record instead of the record itself if
records is a table, it will be opened and closed if necessary |
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
|
|
|
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,
encoding=None,
errors=None)
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
|
|
|
|
|
gather(record,
data,
drop=False)
saves data into a record's fields; writes to disk if not in flux keys
with no matching field will raise a FieldMissingError exception
unless drop_missing == True; if an Exception occurs the record is
restored before reraising |
source code
|
|
|
scan(table,
direction='forward',
filter=lambda rec: True)
moves record pointer forward 1; returns False if Eof/Bof reached
table must be derived from _Navigation or have skip() method |
source code
|
|
|
scatter(record,
as_type=create_template,
_mappings=getattr(collections,'Mapping',dict))
returns as_type() of [fieldnames and] values. |
source code
|
|