|
IsoDay
|
|
RelativeDay
|
|
IsoMonth
|
|
RelativeMonth
|
|
bytes
str(object='') -> string
|
|
property
2.6 properties for 2.5-
|
|
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
|
|
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
|
|
BytesType
|
|
IntBytesType
add big_endian and neg_one to __init__
|
|
Int8
1-byte integer
|
|
Int16
2-byte integer
|
|
Int32
4-byte integer
|
|
Bytes
|
|
DataBlock
adds _data as a str to class binds variable name to BytesType
descriptor
|
|
LruCache
keep the most recent n items in the dict
|
|
Idx
|
|
_Db4Table
under development
|
|
|
|
|
|
|
|
|
|
none(*args,
**kwargs)
because we can't do `NoneType()` |
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
|
|
|
pql_select(records,
chosen_fields,
condition,
field_names) |
source code
|
|
|
pql_update(records,
command,
condition,
field_names) |
source code
|
|
|
pql_delete(records,
dead_fields,
condition,
field_names) |
source code
|
|
|
pql_recall(records,
all_fields,
condition,
field_names) |
source code
|
|
|
pql_add(records,
new_fields,
condition,
field_names) |
source code
|
|
|
pql_drop(records,
dead_fields,
condition,
field_names) |
source code
|
|
|
pql_pack(records,
command,
condition,
field_names) |
source code
|
|
|
pql_resize(records,
fieldname_newsize,
condition,
field_names) |
source code
|
|
|
pql_criteria(records,
criteria)
creates a function matching the pql criteria |
source code
|
|
|
pql_cmd(command,
field_names)
creates a function matching to apply command to each record in
records |
source code
|
|
|
pql(records,
command)
recognized pql 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
|
|
|
|
|
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=<function <lambda> at 0x7f9a4899b230>)
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=<function create_template at 0x7f9a4899a500>,
_mappings=<class '_abcoll.Mapping'>)
returns as_type() of [fieldnames and] values. |
source code
|
|
|
py_ver = ( 2, 7)
|
|
LOGICAL_BAD_IS_NONE = True
hash(x)
|
|
input_decoding = ' ascii '
|
|
default_type = ' db3 '
|
|
temp_dir = '
'
|
|
pql_user_functions = { }
|
|
_Template_Records = { }
|
|
days_per_month = [ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, ...
|
|
days_per_leap_month = [ 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, ...
|
|
SYSTEM = 1
|
|
NULLABLE = 2
|
|
BINARY = 4
|
|
TYPE = 0
|
|
START = 1
|
|
LENGTH = 2
|
|
END = 3
|
|
DECIMALS = 4
|
|
FLAGS = 5
|
|
CLASS = 6
|
|
EMPTY = 7
|
|
NULL = 8
|
|
FIELD_FLAGS = { 1: ' system ' , 2: ' null ' , 4: ' binary ' , ' binary ' : ...
|
|
IN_MEMORY = 0
|
|
ON_DISK = 1
|
|
CLOSED = ' closed '
|
|
READ_ONLY = ' read-only '
|
|
READ_WRITE = ' read-write '
|
|
Null = <null>
|
|
Vapor = Vapor()
|
|
basestring = ( <type 'str'>, <type 'unicode'>, <class 'dbf.ver_...
|
|
baseinteger = ( <type 'int'>, <type 'long'>)
|
|
NullDate = Date()
|
|
NullDateTime = DateTime()
|
|
NullTime = Time()
|
|
Truth = Logical('T')
|
|
Falsth = Logical('F')
|
|
Unknown = Logical('?')
|
|
On = Quantum('Y')
|
|
Off = Quantum('N')
|
|
Other = Quantum('?')
|
|
_DeadObject = _DeadObject()
|
|
VFPTIME = 1721425
|
|
table_types = { ' clp ' : <class 'dbf.ver_2.ClpTable'>, ' db3 ' : <cl...
|
|
version_map = { ' \x02 ' : ' FoxBASE ' , ' \x03 ' : ' dBase III Plus ' , ' \ ...
|
|
code_pages = { ' \x00 ' : ( ' ascii ' , ' plain ol\' ascii ' ) , ' \x01 ' : ( ...
|
|
default_codepage = ' ascii '
|
|
pql_functions = {'select': pql_select, 'update': pql_update, '...
|
|
LAST_APRIL = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_AUGUST = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_DECEMBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_FEBRUARY = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_FRIDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
LAST_JANUARY = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_JULY = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_JUNE = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_MARCH = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_MAY = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_MONDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
LAST_NOVEMBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_OCTOBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_SATURDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
LAST_SEPTEMBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
LAST_SUNDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
LAST_THURSDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
LAST_TUESDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
LAST_WEDNESDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_APRIL = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_AUGUST = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_DECEMBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_FEBRUARY = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_FRIDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_JANUARY = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_JULY = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_JUNE = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_MARCH = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_MAY = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_MONDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_NOVEMBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_OCTOBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_SATURDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_SEPTEMBER = <RelativeMonth.NEXT_JUNE: ()>
|
|
NEXT_SUNDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_THURSDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_TUESDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
NEXT_WEDNESDAY = <RelativeDay.LAST_SUNDAY: ()>
|
|
SEEK_CUR = 1
|
|
SEEK_END = 2
|
|
SEEK_SET = 0
|
|
__package__ = ' dbf '
|
|
dbf = <dbf.fake_module object at 0x7f9a48799cd0>
|