Source Csv

Loads records from a csv file, using columns as features

class dffml.source.csv.CSVSource(config)[source]

Uses a CSV file as the source of record feature data

CONFIG

alias of CSVSourceConfig

async dump_fd(fd)[source]

Dumps data into a CSV stream

async load_fd(fd)[source]

Parses a CSV stream into Record instances

class dffml.source.csv.CSVSourceConfig(filename: str, tag: str = 'untagged', readwrite: bool = False, allowempty: bool = False, key: str = 'key', tagcol: str = 'tag', delimiter: str = ',', loadfiles: List[str] = None, nostrip: bool = False)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1
class dffml.source.csv.OpenCSVFile(write_out: Dict, active: int, lock: asyncio.locks.Lock, write_back_key: bool = True, write_back_tag: bool = False)[source]