How to use the pycldf.dataset.Dataset function in pycldf

To help you get started, we’ve selected a few pycldf 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 cldf / cldf / examples / wals / cldf.py View on Github external
def write_cldf(req, contrib, valuesets, features, outdir):
    ds = Dataset('wals-chapter-%s' % contrib.id)
    ds.fields = (
        'ID',
        'Language_ID',
        'Language_name',
        'Parameter_ID',
        'Value',
        'DomainElement',
        'Source',
        'Comment')
    ds.table.schema.aboutUrl = url_template(req, 'valueset', 'ID')
    ds.table.schema.columns['Language_ID'].valueUrl = Identifier(
        type='glottolog', name='{Language_ID}').url()
    ds.table.schema.columns['Parameter_ID'].valueUrl = url_template(
        req, 'parameter', 'Parameter_ID')

    ds.metadata['dc:bibliographicCitation '] = text_citation(req, contrib)

pycldf

A python library to read and write CLDF datasets

Apache-2.0
Latest version published 10 days ago

Package Health Score

75 / 100
Full package analysis