owmeta_core.data_trans.csv_ds module

class owmeta_core.data_trans.csv_ds.CSVDataSource(*args, no_type_decl=False, **kwargs)[source]

Bases: LocalFileDataSource

A CSV file data source

Parameters
commit_opCommitOp, optional

The operation to use for commiting the file changes. The default is COPY

csv_field_delimiter

“CSV field delimiter”, a DatatypeProperty

Default value: ‘,’

csv_file_name

“CSV file name”, a DatatypeProperty

csv_header

“Header column names”, a DatatypeProperty

class owmeta_core.data_trans.csv_ds.CSVDataTranslator(*args, no_type_decl=False, **kwargs)[source]

Bases: DataTranslator

A data translator which handles CSV files

make_reader(source, skipheader=True, dict_reader=False, skiplines=0, **kwargs)[source]

Make a CSV reader

Parameters
sourceCSVDataSource

The data source to read from

skipheaderbool

If true, the first line read of the CSV file after the reader is created will not be returned from the reader

dict_readerbool

If true, the reader will be a DictReader

skiplinesint

A number of lines to skip before creating the reader. Useful if the CSV file contains some commentary or other ‘front matter’

**kwargs

Remaining arguments passed on to reader or DictReader

reader(source, skipheader=True, dict_reader=False, skiplines=0, **kwargs)

Alias to make_reader

class owmeta_core.data_trans.csv_ds.CSVHTTPFileDataSource(*args, no_type_decl=False, **kwargs)[source]

Bases: HTTPFileDataSource

A CSV file retrieved over HTTP

csv_field_delimiter

“CSV field delimiter”, a DatatypeProperty

Default value: ‘,’

csv_header

“Header column names”, a DatatypeProperty