Fixed-width reader#
Agate contains a fixed-width file reader that is designed to work like Python’s csv
.
These readers work with CSV-formatted schemas, such as those maintained at wireservice/ffs.
A wrapper around |
|
Reads a fixed-width file using a column schema in CSV format. |
|
A fixed-width reader that returns |
Detailed list#
- agate.fixed.reader(*args, **kwargs)#
A wrapper around
fixed.Reader
, so that it can be used in the same way as a normal CSV reader.
- class agate.fixed.Reader(f, schema_f)#
Bases:
object
Reads a fixed-width file using a column schema in CSV format.
This works almost exactly like Python’s built-in CSV reader.
Schemas must be in the “ffs” format, with
column
,start
, andlength
columns. There is a repository of such schemas maintained at wireservice/ffs.- property fieldnames#
The names of the columns read from the schema.
- class agate.fixed.DictReader(f, schema_f)#
Bases:
Reader
A fixed-width reader that returns
collections.OrderedDict
rather than a list.