pysal

Previous topic

IOHandlers.gwt — GWT Plugin for PySAL’s FileIO System

This Page

IOHandlers.pyDbfIO — DBF Plugin for PySAL’s FileIO System

The IOHandlers.pyDbfIO DBF Plugin for PySAL’s FileIO System

New in version 1.0.

class pysal.core.IOHandlers.pyDbfIO.DBF(*args, **kwargs)

PySAL DBF Reader/Writer

This DBF handler implements the PySAL DataTable interface.

Examples

>>> import pysal
>>> dbf = pysal.open('../../examples/juvenile.dbf', 'r')
>>> dbf.header
['ID', 'X', 'Y']
>>> dbf.field_spec
[('N', 9, 0), ('N', 9, 0), ('N', 9, 0)]

Attributes

Methods

by_col
by_row
cast
check
close
flush
get
getType
next
open
read
read_record
seek
tell
truncate
write
class by_col(parent)
class DBF.by_row(parent)
DBF.cast(key, typ)
cast key as typ
classmethod DBF.check()
Prints the contents of the registry
DBF.close()
DBF.flush()
DBF.get(n)
Seeks the file to n and returns n If .ids is set n should be an id, else, n should be an offset
static DBF.getType(dataPath)
Parse the dataPath and return the data type
DBF.ids
DBF.next()
A FileIO object is its own iterator, see StringIO
classmethod DBF.open(*args, **kwargs)
Alias for FileIO()
DBF.rIds
DBF.read(n=-1)
Read at most n objects, less if read hits EOF if size is negative or omitted read all objects until EOF returns None if EOF is reached before any objects.
DBF.read_record(i)
DBF.seek(i)
DBF.tell()
Return id (or offset) of next object
DBF.truncate(size=None)
Should be implemented by subclasses and redefine this doc string
DBF.write(obj)