wfexs_backend.pushers.zenodo_export#

Module Contents#

Classes#

ZenodoExportPlugin

Class to model exporting results to Zenodo

API#

class wfexs_backend.pushers.zenodo_export.ZenodoExportPlugin(refdir: pathlib.Path, setup_block: SecurityContextConfig | None = None, default_licences: Sequence[LicenceDescription] = [], default_orcids: Sequence[ResolvedORCID] = [], default_preferred_id: str | None = None)#

Bases: wfexs_backend.pushers.abstract_token_sandboxed_export.AbstractTokenSandboxedExportPlugin

Class to model exporting results to Zenodo

Initialization

PLUGIN_NAME: ClassVar[SymbolicName] = 'cast(...)'#
ENABLED: ClassVar[bool] = True#
ZENODO_PREFIX: Final[str] = 'https://zenodo.org'#
SANDBOX_ZENODO_PREFIX: Final[str] = 'https://sandbox.zenodo.org'#
DEFAULT_REMOTE_PATH_SEPARATOR: Final[str] = '__'#
get_api_prefix() str#
_gen_headers() MutableMapping[str, str]#
book_pid(preferred_id: str | None = None, initially_required_metadata: Mapping[str, Any] | None = None, initially_required_community_specific_metadata: Mapping[str, Any] | None = None, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = []) DraftEntry | None#
_book_pid_internal(preferred_id: str | None = None, initially_required_metadata: Mapping[str, Any] | None = None, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = []) Tuple[str | None, str | None, Mapping[str, Any] | None]#

We are booking a new PID, in case the default preferred id is None or an invalid one

property _customized_book_pid_error_string: str#

This method can be overridden to provide more context

discard_booked_pid(pid_or_draft: str | DraftEntry) bool#
get_pid_metadata(pid: str) Mapping[str, Any] | None#
get_file_bucket_prefix(draft_entry: wfexs_backend.pushers.DraftEntry) str#

This is an accessory method which is used to build upload paths

upload_file_to_draft(draft_entry: wfexs_backend.pushers.DraftEntry, filename: str | IO[bytes], remote_filename: str | None, content_size: int | None = None) Mapping[str, Any]#
update_record_metadata(draft_entry: wfexs_backend.pushers.DraftEntry, metadata: Mapping[str, Any] | None = None, community_specific_metadata: Mapping[str, Any] | None = None, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = []) Mapping[str, Any]#
publish_draft_record(draft_entry: wfexs_backend.pushers.DraftEntry) Mapping[str, Any]#