35 "type":
"CsvReadDataProvider",
36 "supports_read": True,
38 "supports_search_expressions": True,
41 "expressions": AbstractDataProvider::GenericExpressions,
46 "path": <DataProviderOptionInfo>{
47 "type": AbstractDataProviderType::get(StringType),
48 "desc":
"the location of the CSV data; mutually exclusive with \"stream\"; resolved with a call to "
49 "FileLocationHandler::getBinaryStreamFromLocation()",
51 "stream": <DataProviderOptionInfo>{
52 "type": AbstractDataProviderType::get(
new Type(
"InputStream")),
53 "desc":
"an input stream for CSV data; mutually exclusive with \"path\"",
55 "date_format": <DataProviderOptionInfo>{
56 "type": AbstractDataProviderType::get(StringType),
57 "desc":
"the default date format for `date` fields (ex: `DD/MM/YYYY HH:mm:SS`)",
59 "encoding": <DataProviderOptionInfo>{
60 "type": AbstractDataProviderType::get(StringType),
61 "desc":
"character encoding for the file (and output data)",
63 "eol": <DataProviderOptionInfo>{
64 "type": AbstractDataProviderType::get(StringType),
65 "desc":
"the end of line character(s); if not specified, then the end-of-line characters will be "
68 "fields": <DataProviderOptionInfo>{
69 "type": AbstractDataProviderType::get(AutoHashType),
70 "desc":
"the keys are field names as given by the `header_names` or `headers` options (in case "
71 "neither of these options are used, then field names are numbers starting with `0`) and the "
72 "values are either strings (one of `bool`, `int`, `float`, `number`, `string`, `date`, "
73 "optionally prefixed by `*` if the value is optional) or a hash describing the field; also sets "
74 "`headers` if not set automatically with `header_names`; if no field type is given, the default "
75 "is `*string`; note that invalid field names given in this option are ignored",
77 "header_lines": <DataProviderOptionInfo>{
78 "type": AbstractDataProviderType::get(SoftIntType),
79 "desc":
"the number of headers lines in the file",
81 "header_names": <DataProviderOptionInfo>{
82 "type": AbstractDataProviderType::get(SoftBoolType),
83 "desc":
"if `true` then the object will parse the header names from the first header row, in this "
84 "case if `header_lines` is not set explicitly, it will be assumed to be `1`",
86 "header_reorder": <DataProviderOptionInfo>{
87 "type": AbstractDataProviderType::get(SoftBoolType),
88 "desc":
"if `true` (the default) then if `headers` are provided, then data fields are reordered to "
91 "headers": <DataProviderOptionInfo>{
92 "type": AbstractDataProviderType::get(
new Type(
"softlist<string>")),
93 "desc":
"list of header / column names for the data iterated; if this is present, then "
94 "`header_names` must be `false`",
96 "ignore_empty": <DataProviderOptionInfo>{
97 "type": AbstractDataProviderType::get(SoftBoolType),
98 "desc":
"if `true`, empty lines will be ignored",
100 "ignore_whitespace": <DataProviderOptionInfo>{
101 "type": AbstractDataProviderType::get(SoftBoolType),
102 "desc":
"if `true`, leading and trailing whitespace will be stripped from non-quoted fields",
104 "number_format": <DataProviderOptionInfo>{
105 "type": AbstractDataProviderType::get(StringType),
106 "desc":
"the default format for `int`, `float`, and `number` fields as a string giving the thousands "
107 "separator character followed by the decimal separator character (ex: `.,` for "
108 "continental-European-style numbers)",
110 "quote": <DataProviderOptionInfo>{
111 "type": AbstractDataProviderType::get(StringType),
112 "desc":
"the field quote character (default: `\"`)",
114 "separator": <DataProviderOptionInfo>{
115 "type": AbstractDataProviderType::get(StringType),
116 "desc":
"the string separating the fields in the file (default: `,`)",
118 "timezone": <DataProviderOptionInfo>{
119 "type": AbstractDataProviderType::get(StringType),
120 "desc":
"the timezone region to use when parsing dates (ex: `Europe/Prague`)",
122 "tolwr": <DataProviderOptionInfo>{
123 "type": AbstractDataProviderType::get(SoftBoolType),
124 "desc":
"if `true` (default `false`), all header names will be converted to lower case letters",
126 "verify_columns": <DataProviderOptionInfo>{
127 "type": AbstractDataProviderType::get(SoftBoolType),
128 "desc":
"if `true` (default `false`), if a line is parsed with a different column or field count "
129 "than other lines, a `CSVFILEITERATOR-DATA-ERROR` exception is raised",
175 AbstractDataProviderRecordIterator
searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
183 private AbstractDataProviderRecordIterator
searchRecordsImpl(*hash<DataProviderExpression> where_cond,
184 *hash<auto> search_options) {
185 return new DefaultRecordIterator(
i, where_cond, search_options, getRecordType());
the AbstractCsvIterator class is an abstract base class that allows abstract CSV data to be iterated
Definition: AbstractCsvIterator.qc.dox.h:285
Provides a data provider for reading CSV files.
Definition: CsvReadDataProvider.qc.dox.h:30
const ProviderInfo
Provider info.
Definition: CsvReadDataProvider.qc.dox.h:34
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
constructor(string path, *hash< auto > opts)
Creates the CsvReadDataProvider with the input data path and optionally an option hash.
AbstractDataProviderRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
const ConstructorOptions
Constructor options.
Definition: CsvReadDataProvider.qc.dox.h:45
string getName()
Returns the object name.
constructor(InputStream stream, *hash< auto > opts)
Creates the CsvReadDataProvider with the input data stream and optionally an option hash.
private AbstractDataProviderRecordIterator searchRecordsImpl(*hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
Definition: CsvReadDataProvider.qc.dox.h:183
constructor(*hash< auto > options)
Creates the object from constructor options.
const CsvIterationOptionList
CSV iteration option list.
Definition: CsvReadDataProvider.qc.dox.h:134
AbstractCsvIterator i
the iterator object
Definition: CsvReadDataProvider.qc.dox.h:138
const GenericRecordSearchOptions
the CsvUtil namespace. All classes used in the CsvUtil module should be inside this namespace
Definition: AbstractCsvIterator.qc.dox.h:28