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 csvWrapper.by_row(parent)
-
csvWrapper.cast(key, typ)
- cast key as typ
-
classmethod csvWrapper.check()
- Prints the contents of the registry
-
csvWrapper.close()
- subclasses should clean themselves up and then call this method
-
csvWrapper.flush()
-
csvWrapper.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 csvWrapper.getType(dataPath)
- Parse the dataPath and return the data type
-
csvWrapper.ids
-
csvWrapper.next()
- A FileIO object is its own iterator, see StringIO
-
classmethod csvWrapper.open(*args, **kwargs)
- Alias for FileIO()
-
csvWrapper.rIds
-
csvWrapper.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.
-
csvWrapper.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
-
csvWrapper.tell()
- Return id (or offset) of next object
-
csvWrapper.truncate(size=None)
- Should be implemented by subclasses
and redefine this doc string
-
csvWrapper.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