This chapter is dedicated to the itools.csv package, which offers a handler1 to work with CSV files.
This handler is interesting to use when the CSV file at hand has the structure it is expected to have. That is to say, when it represents a table where each row has the same number of columns, and where each column contains a value of the expected type. For instance:
Client Id
Name
Registration Date
1
Piotr Macuk
piotr@macuk.pl
2004-11-09
2
J. David Ibañez
jdavid@itaapy.com
2006-01-01
The functional scope of the CSV handler, what it is able to do, is:
Offers a programming interface to get, add and remove rows.
If an schema is defined, the values will be deserialized, so we will work with text strings, integers and booleans (instead of byte strings).
With the help of the schema, it will be possible to quickly search for rows that match one or another value (kind of an SQL select for a single table).
Footnotes