Skip to main content

cldfzenodo

Build Status PyPI

cldfzenodo provides programmatic access to CLDF data deposited on Zenodo.

NOTE: The Zenodo upgrade from October 13, 2023 introduced quite a few changes in various parts of the system. Thus, cldfzenodo before version 2.0 cannot be used anymore. cldfzenodo is meant to be backwards compatible, i.e. provides the same Python API as cldfzenodo 1.x - but may issue deprecation warnings.

Install

pip install cldfzenodo

pycldf dataset resolver

cldfzenodo registers (upon installation) a pycldf dataset resolver for dataset locators of the form https://doi.org/10.5281/zenodo.[0-9]+ and https://zenodo.org/record/[0-9]+. Thus, after installation you should be able to retrieve pycldf.Dataset instances running

>>> from pycldf.ext.discovery import get_dataset
>>> import pathlib
>>> 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'

CLI

cldfzenodo provides a subcommand to be run from cldfbench. To make use of this command, you have to install cldfbench, which can be done via

pip install cldfzenodo[cli]

Then you can download CLDF datasets from Zenodo, using the DOI for identification. E.g.

cldfbench zenodo.download 10.5281/zenodo.4683137  --directory wals-2020.1/

will download WALS Online as CLDF dataset into wals-2020.1:

$ tree wals-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.csv

0 directories, 12 files

API

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:
    >>> from cldfzenodo import API
    >>> rec = API.get_record(doi='10.5281/zenodo.4762034')
    >>> rec.title
    'glottolog/glottolog: Glottolog database 4.4 as CLDF'
    
  • Via concept DOI and version tag:
    >>> from cldfzenodo import API
    >>> 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:
    >>> from cldfzenodo import API
    >>> for rec in API.iter_records(community='dictionaria'):
    ...     print(rec.title)
    ...     break
    ...     
    dictionaria/iquito: Iquito dictionary
    
  • From search results using keywords:
    >>> from cldfzenodo import API
    >>> for rec in API.iter_records(keyword='cldf:Wordlist'):
    ...     print(rec.title)
    ...     break
    ...     
    CLDF dataset accompanying Zariquiey et al.'s "Evolution of Body-Part Terminology in Pano" from 2022
    

cldfzenodo.Record objects provide sufficient metadata to allow identification and data access:

>>> from cldfzenodo import API
>>> print(API.get_record(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

API.get_record(doi='...').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

cldf = API.get_record(doi='...').download_dataset('my_directory')

Metadata

Release files for cldfzenodo 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cldfzenodo 3.1.0
File Size Uploaded Provenance Actions
cldfzenodo-3.1.0.tar.gz 22.0 kB Without provenance Details for cldfzenodo-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cldfzenodo 3.1.0
File Interpreter ABI Platform Actions
cldfzenodo-3.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for cldfzenodo-3.1.0-py2.py3-none-any.whl

Total release size: 39.7 kB

Release files / cldfzenodo-3.1.0.tar.gz

Download URL cldfzenodo-3.1.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d878cbd3ff9ec2621798bc6b4baaa422495c396d391a6f31ef6db84f6e395ea2
BLAKE2b-256 checksum
How to use checksums
7bfb467322b169fe1bfea0af30bbf48f35b56c9ae696e17dd148221f9f7d0b17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / cldfzenodo-3.1.0-py2.py3-none-any.whl

Download URL cldfzenodo-3.1.0-py2.py3-none-any.whl
Size 17.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
72ad91bb96696ca12da44ad3d522520956d3e7f5b8d3f4d9d7241dd5b3624723
BLAKE2b-256 checksum
How to use checksums
589bd07e883c70367f3aa47f39a72bd6c57f8a9108d4539a7cac8c87b2a1b78a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for cldfzenodo 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page