How to use the clldutils.dsv.reader function in clldutils

To help you get started, we’ve selected a few clldutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github clld / clld / clld / lib / iso.py View on Github external
def get_tab(name):
    """Generator for entries in a tab file specified by name."""
    return dsv.reader(
        get(get_taburls()[name]).split('\n'), namedtuples=True, delimiter='\t')
github clld / clld / clld / scripts / freeze.py View on Github external
def load(table, csv, engine):
    schema = jsonlib.load(csv.parent.joinpath(csv.stem + '.' + CsvmJsonAdapter.extension))
    converter = get_converter(schema['tableSchema'], table)
    engine.execute(
        table.insert(), [converted(d, converter) for d in reader(csv, dicts=True)])
    return schema.get("dc:identifier")