functionality to retrieve CLDF datasets deposited on Zenodo
Project description
cldfzenodo
cldfzenodo
provides programmatic access to CLDF data deposited on Zenodo.
Install
pip install cldfzenodo
Usage
Metadata and data of (potential) CLDF datasets deposited on Zenodo is accessed via cldfzenodo.Record
objects. Such objects can be obtained in various ways:
- Via DOI:
import cldfzenodo rec = cldfzenodo.Record.from_doi('https://doi.org/10.5281/zenodo.4762034')
- From deposits grouped into a Zenodo community (and obtained through OAI-PMH):
import cldfzenodo.oai for rec in cldfzenodo.oai.iter_records('dictionaria'): print(rec)
- From search results using keywords:
import cldfzenodo for rec in cldfzenodo.search_wordlists(): print(rec)
cldfzenodo.Record
objects provide sufficient metadata to allow identification and data access:
>>> from cldfzenodo import Record
>>> print(Record.from_doi('10.5281/zenodo.4762034').bibtex)
@misc{zenodo-4762034,
author = {Hammarström, Harald and Forkel, Robert and Haspelmath, Martin and Bank, Sebastian},
title = {glottolog/glottolog: Glottolog database 4.4 as CLDF},
keywords = {cldf:StructureDataset, linguistics},
publisher = {Zenodo},
year = {2021},
doi = {10.5281/zenodo.4762034},
url = {https://doi.org/10.5281/zenodo.4762034},
copyright = {Creative Commons Attribution 4.0}
}
One can download the full deposit (and access - possible multiple - CLDF datasets):
from pycldf import iter_datasets
record.download('my_directory')
for cldf in iter_datasets('my_directory'):
pass
But often, only the "pure" CLDF data is of interest - and not the additional metadata and curation context, e.g. of cldfbench-curated datasets. This can be done via
from pycldf import Dataset
mdpath = record.download_dataset('my_directory')
cldf = Dataset.from_metadata(mdpath)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cldfzenodo-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406f3c49a3cf8b706c04d40e763e69e55f5a9e75c1fb5a221ccd63966f496c32 |
|
MD5 | 5f838e47038c5a1c0d206cbab6b5ed4d |
|
BLAKE2b-256 | 5785b340d4d796521d6f9ffe60b4557f03e34e6c5d7867f3ddfbe13ebe804b82 |