Part of stoqlib.importers.csvimporter View In Hierarchy
Known subclasses: stoqlib.importers.branchimporter.BranchImporter, stoqlib.importers.clientimporter.ClientImporter, stoqlib.importers.creditproviderimporter.CreditProviderImporter, stoqlib.importers.employeeimporter.EmployeeImporter, stoqlib.importers.invoiceimporter.InvoiceImporter, stoqlib.importers.productimporter.ProductImporter, stoqlib.importers.purchaseimporter.PurchaseImporter, stoqlib.importers.saleimporter.SaleImporter, stoqlib.importers.serviceimporter.ServiceImporter, stoqlib.importers.supplierimporter.SupplierImporter, stoqlib.importers.transferimporter.TransferImporter, stoqlib.importers.transporterimporter.TransporterImporter
Class Variables | fields | field names, a list of strings |
optional_fields | optional field names, a list of strings | |
dialect | optional, csv dialect, defaults to excel |
Method | __init__ | Create a new CSVImporter object. |
Method | feed_file | Feeds csv data from filename to the importer |
Method | feed | Feeds csv data from an iterable |
Method | parse_date | Undocumented |
Method | parse_multi | Undocumented |
Method | set_lines_per_commit | Sets the number of lines which should be parsed between commits. |
Method | set_dry | Tells the CSVImporter to run in dry mode, eg without committing |
Class Method | get_by_type | Gets an importers class, instantiates it returns it |
Method | process_one | Processes one line in a csv file, you can access the columns |
Method | read | This can be overridden by as subclass which wishes to specialize |
Method | before_start | This is called before all the lines are parsed but |
Method | when_done | This is called after all the lines are parsed but |
Parameters | lines | see set_lines_per_commit
|
dry | see set_dry
|
Parameters | filename | filename |
skip | optional, number of rows to initially skip |
Parameters | iterable | an iterable |
filename | optinal, name of input file | |
skip | optional, number of rows to initially skip |
Parameters | lines | number of lines or |
Parameters | dry | dry mode |
Parameters | importer_type | an importer (type: string ) |
(type: CSVImporter
subclass
) | ||
Returns | an importer instance |
Parameters | row | object representing a row in the input |
fields | a list of fields set in data | |
trans | a database transaction |
Parameters | iterable | a sequence of lines which are going to be read |
Returns | a sequence of parsed items |