Zotero

Note

This functionality is available, when collabutils is installed with the zotero extra, i.e. via

pip install collabutils[zotero]

Zotero provides a good platform to collaborate on bibliogrpahies.

We support collaborative curation of bibliographical data as follows:

  • The data is curated in a shared Zotero library.

  • Items in this library are tagged for membership in the bibliographies of certain datasets, using tags of the form “dataset:<dataset-id>”.

  • Items are optionally tagged with tags of the form “id:<dataset-id>:<local-id>” for local BibTeX keys in a specific dataset.

An instance of Zotero allows

class collabutils.zotero.Zotero(libid, apikey, group=True)[source]

A high-level Zotero API client. Low level communication with Zotero is done using the pyzotero package.

upload_bib(dataset_id, bibpath, log=None)[source]

Upload items from a BibTeX file as items of the Zotero library for a dataset.

Parameters
  • dataset_id – Dataset identifier (e.g. a cldfbench.Dataset.id).

  • bibpath – Path to the BibTeX file to be uploaded.

  • log

Returns

download_bib(dataset_id, bibpath=None, remove=None)[source]

Download all items tagged for a dataset into a BibTeX file.

Parameters
  • dataset_id

  • bibpath

  • remove – List of field names to remove (e.g. the “keywords” field, which is popuated by Zotero’s BibTeX export with all tags) or None.

Returns

delete_bib(dataset_id, log=None)[source]

Delete all items tagged for a dataset - unless they are tagged for other datasets as well.

Parameters
  • dataset_id

  • log

Returns

create_item(src, *tags)[source]