DataTable provides additional functionality to FileIO for data table file tables
FileIO Handlers the provide data tables should subclass this instead of FileIO
Methods
-
class by_col(parent)
-
class DataTable.by_row(parent)
-
DataTable.cast(key, typ)
- cast key as typ
-
classmethod DataTable.check()
- Prints the contents of the registry
-
DataTable.close()
- subclasses should clean themselves up and then call this method
-
DataTable.flush()
-
DataTable.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 DataTable.getType(dataPath)
- Parse the dataPath and return the data type
-
DataTable.ids
-
DataTable.next()
- A FileIO object is its own iterator, see StringIO
-
classmethod DataTable.open(*args, **kwargs)
- Alias for FileIO()
-
DataTable.rIds
-
DataTable.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.
-
DataTable.seek(n)
- Seek the FileObj to the beginning of the n’th record,
if ids are set, seeks to the beginning of the record at id, n
-
DataTable.tell()
- Return id (or offset) of next object
-
DataTable.truncate(size=None)
- Should be implemented by subclasses
and redefine this doc string
-
DataTable.write(obj)
- Must be implemented by subclasses that support ‘w’
subclasses should increment .pos
subclasses should also check if obj is an instance of type(list)
and redefine this doc string