Package: cldfzenodo
cldfzenodocldfzenodoprovides programmatic access to CLDF data deposited onZenodo.NOTE:The Zenodo upgrade from October 13, 2023 introduced quite a few changes in various parts
of the system. Thus,cldfzenodobefore version 2.0 cannot be used anymore.cldfzenodois meant
to be backwards compatible, i.e. provides the same Python API ascldfzenodo1.x - but may issue
deprecation warnings.Installpipinstallcldfzenodopycldfdataset resolvercldfzenodoregisters (upon installation) apycldfdataset resolverfor dataset locators of the formhttps://doi.org/10.5281/zenodo.[0-9]+andhttps://zenodo.org/record/[0-9]+.
Thus, after installation you should be able to retrievepycldf.Datasetinstances running>>>frompycldf.ext.discoveryimportget_dataset>>>importpathlib>>>pathlib.Path('wacl').mkdir()>>>ds=get_dataset('https://doi.org/10.5281/zenodo.7322688',pathlib.Path('wacl'))>>>ds.properties['dc:title']'World Atlas of Classifier Languages'CLIcldfzenodoprovides a subcommand to be run fromcldfbench.
To make use of this command, you have to installcldfbench, which can be done viapipinstallcldfzenodo[cli]Then you can download CLDF datasets from Zenodo, using the DOI for identification. E.g.cldfbenchzenodo.download10.5281/zenodo.4683137--directorywals-2020.1/will download WALS Online as CLDF dataset intowals-2020.1:$treewals-2020.1/
wals-2020.1/
├──areas.csv
├──chapters.csv
├──codes.csv
├──contributors.csv
├──countries.csv
├──examples.csv
├──language_names.csv
├──languages.csv
├──parameters.csv
├──sources.bib
├──StructureDataset-metadata.json
└──values.csv0directories,12filesAPIMetadata and data of (potential) CLDF datasets deposited on Zenodo is accessed viacldfzenodo.Recordobjects. Such objects can be obtained in various ways:Via DOI:>>>fromcldfzenodoimportAPI>>>rec=API.get_record(doi='10.5281/zenodo.4762034')>>>rec.title'glottolog/glottolog: Glottolog database 4.4 as CLDF'Viaconcept DOIand version tag:>>>fromcldfzenodoimportAPI>>>rec=API.get_record(conceptdoi='10.5281/zenodo.3260727',version='4.5')>>>rec.title'glottolog/glottolog: Glottolog database 4.5 as CLDF'From deposits grouped into a Zenodo community:>>>fromcldfzenodoimportAPI>>>forrecinAPI.iter_records(community='dictionaria'):...print(rec.title)...break...dictionaria/iquito:IquitodictionaryFrom search results using keywords:>>>fromcldfzenodoimportAPI>>>forrecinAPI.iter_records(keyword='cldf:Wordlist'):...print(rec.title)...break...CLDFdatasetaccompanyingZariquieyetal.'s "Evolution of Body-Part Terminology in Pano" from 2022cldfzenodo.Recordobjects provide sufficient metadata to allow identification and data access:>>>fromcldfzenodoimportAPI>>>print(API.get_record(doi='10.5281/zenodo.4762034').bibtex)@misc{zenodo-4762034,author={Hammarström,HaraldandForkel,RobertandHaspelmath,MartinandBank,Sebastian},title={glottolog/glottolog:Glottologdatabase4.4asCLDF},keywords={cldf:StructureDataset,linguistics},publisher={Zenodo},year={2021},doi={10.5281/zenodo.4762034},url={https://doi.org/10.5281/zenodo.4762034},copyright={CreativeCommonsAttribution4.0}}One can download the full deposit (and access - possible multiple - CLDF datasets):frompycldfimportiter_datasetsAPI.get_record(doi='...').download('my_directory')forcldfiniter_datasets('my_directory'):passBut often, only the "pure" CLDF data is of interest - and not the additional metadata and curation
context, e.g. ofcldfbench-curated datasets. This can be done
viacldf=API.get_record(doi='...').download_dataset('my_directory')