README for typhoonmodule.c version 1.0beta-1 Lance Ellinghaus (Note - the author also posted a patch for the find method, included in this dir as 'typhoonmodule.c-patch'.) This module interfaces with the typhoon (version 1.10.3) database that can be found in the Linux distribution. Add this line to your Setup file to use this: typhoon typhoonmodule.c /usr/local/lib/libtyphoon.a -I/u2/lance/src/typhoon-1.10.3/src -I/u2/lance/src/typhoon-1.10.3/include There are a number of data types: 1) Database 2) Sequence 3) Record 4) Record Buffer To use this module, there are a few things you need to set up from inside the python program. These are done using 'setdbfpath' and 'setdbdpath'. These tell the typhoon library where to find the data files and the DBD description file for the different databases you will be opening. Both of these can be changed during the operation of the python program. Here are the methods and return values for the different data objects defined in this file: Database Object: records() -> listobject containing names of records defined in this database sequences() -> listobject containing names of sequences defined in this database values() -> listobject containing record and sequence objects defined items() -> listobject of tuples containing (name,object) pairs of records and sequences keys() -> listobject containing all names of records and sequences defined kas_key('name') -> [1|0] if name is a sequence or record in this database len() -> number of sequences and records defined object['name'] -> sequence or record object of given name Sequence Object: int(sequence_object) -> intobject containing next incremental number NOTE: you must use the int() function to retrieve this value Record Object: len() -> number of records in datafile keys() -> listobject containing names of all index keys new() -> return blank record buffer object recfirst() -> return record buffer of first record in file reclast() -> return record buffer of last record in file recnext() -> return record buffer of next record in file recprev() -> return record buffer of previous record in file find('index',{}|obj) -> return record buffer of found record in index 'index' the second argument is a dictionary for compound keys or a single object for non-compound keys keyfirst('index') -> return record buffer of first record in index 'index' keylast('index') -> return record buffer of last record in index 'index' keynext('index') -> return record buffer of next record in index 'index' keyprev('index') -> return record buffer of previous record in index 'index' Record Buffer Object: values() -> listobject containing data fields in same order as as defined in the DDL file items() -> listobject containing tuple of ('name',value) pairs keys() -> listobject containing names of fields has_key('name') -> [0|1] is 'name' a valid field name isvalid() -> has this record buffer been commited yet commit() -> commit changes to data file, mark as valid delete() -> delete record from data file, mark as invalid object['name'] -> set or get values for field named 'name'