Skip to content

Refactor command line options #1

@bjohas

Description

@bjohas

Maybe we should have verbs:

zotzen install
zotzen new -> create
zotzen link
zotzen push

zotzen -h says what those verbs do.

-h, --help Show this help message and exit.
-v, --version Show program's version number and exit.
--show Show the zotero, zenodo item information
--open Open the zotero and zenodo link after creation
--debug Enable debug logging
install Install the config for Zotero and Zenodo.
new Create a new pair of Zotero/Zenodo entries.
link
push

zotzen create -h

Create a new zotero and a new zenodo record and link them.

--title TITLE Title of the new entries (for --new).
--json JSON A Zotero json file to be used for the Zotero entry
(for --new).
--group GROUP Group ID for which the new item Zotero is to be
created (for --new).
--template TEMPLATE Path of the template to be used for creating Zenodo
record.

Enhancements:

    1. It would be good if this 'autofilled' the needed fields on Zenodo with blanks. I.e., if not title/author is available, it just uses 'unknown'. This means the user can create a pair of records, and edit them, then do a sync.
  • It would be good if there were options for adding the essential fields (title, authors, etc, ... see card on zenodo-cli create)
  • zenodo-cli needs a *files argument , which may be a single Zenodo json record... we should check what it does and give an error message.

zotzen link -h

Link an existing zotero item to a new zenodo record or link it with with an existing zenodo record in the DOI.
zotero-item (one positional item)

--getdoi Generate a DOI for an existing Zotero item.
--zen ZEN Existing Zenodo record id of the item to be linked.

Either --getdoi or --zen are required.

Use cases:

    1. You have a zotero item already, and you want to get a DOI for it.
    1. You have a zotero item already and you have a zenodo item already, and you want to use the existing DOI for the zotero item.

(If the item has a Zenodo DOI already, an error message is displayed:

The Zotero item has a Zenodo DOI already. If you really want to link this to a new record in Zenodo, please manually remove the DOI first. You can use the --open option to open the Zotero/Zenodo items to make adjustments.)

(If the Zenodo item is linked against a different Zotero item: The Zenodo item is already linked with a different Zotero item. Do you want to proceed? y/n?)

zotzen push -h

--sync Sync metadata from zotero to zenodo.
[Rename to --metadata]

--push Push Zotero attachments to Zenodo.
[Rename to --attachments]

--type TYPE Type of the attachments to be pushed.
--publish Publish zenodo record.
One or more positional arguments (zotero items)

This option requires items to be linked already (e.g., using zotzen link).

(Error message if the item is unlinked: The Zotero item XYZ is not linked to a Zenodo item. Please link it first:

zotzen link XYZ --getdoi
zotzen link XYZ --zen 123

)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions