Esempio n. 1
0
def run(args):
    dataset = get_dataset(args)
    dataset.concepticon = args.concepticon.api
    dataset.glottolog = args.glottolog.api
    with_dataset(args, 'makecldf', dataset=dataset)
    if not dataset.cldf_dir.joinpath('sources.bib').exists():
        raise ValueError('The dataset has no sources at {0}'.format(
            dataset.cldf_dir.joinpath('sources.bib')))
    creators, contributors = dataset.get_creators_and_contributors(
        strict=False)

    def contrib(d):
        return {
            k: v
            for k, v in d.items()
            if k in {'name', 'affiliation', 'orcid', 'type'}
        }

    with jsonlib.update_ordered(dataset.dir / '.zenodo.json', indent=4) as md:
        md.update({
            'title':
            dataset.metadata.title,
            "access_right":
            "open",
            "keywords":
            sorted(
                set(md.get('keywords', []) +
                    ["linguistics", "cldf:Wordlist"])),
            "creators": [contrib(p) for p in creators],
            "contributors": [contrib(p) for p in contributors],
            "communities":
            sorted(md.get('communities', []) + [{
                "identifier": "lexibank"
            }],
                   key=lambda i: i['identifier']),
            "upload_type":
            "dataset",
        })
        if dataset.metadata.citation:
            md['description'] = "<p>Cite the source of the dataset as:</p>\n\n" \
                                "<blockquote>\n<p>{}</p>\n</blockquote>".format(
                html.escape(dataset.metadata.citation))
        if dataset.metadata.zenodo_license:
            md['license'] = {'id': dataset.metadata.zenodo_license}
Esempio n. 2
0
def run(args):
    res = with_dataset(args, diff)
    if res == 2:
        args.log.info(
            '----------------------------------------------------------------------'
        )
        args.log.info(
            'Please commit and push changes to GitHub before releasing the dataset!'
        )
        args.log.info(
            '----------------------------------------------------------------------'
        )
    return res
Esempio n. 3
0
def run(args):
    with_dataset(args, 'create_ref_etc_files')
Esempio n. 4
0
def run(args):
    with_dataset(args, 'makecldf')
    if getattr(args, 'with_cldfreadme', None):
        cldfreadme.run(args)
    if getattr(args, 'with_zenodo', None):
        zenodo.run(args)
Esempio n. 5
0
def run(args):
    with_dataset(args, 'makecldf')
def run(args):
    with_dataset(args, create_language_sheet)
Esempio n. 7
0
def run(args):
    with_dataset(args, check_profile)
Esempio n. 8
0
def run(args):
    with_dataset(args, args.cmd)
Esempio n. 9
0
def run(args):
    with_dataset(args, check)
Esempio n. 10
0
def run(args):
    with_dataset(args, 'download')
Esempio n. 11
0
def run(args):
    with_dataset(args, check_segments)
Esempio n. 12
0
def run(args):
    with_dataset(args, check_phonotactics)