wfexs_backend.pushers.b2share_export#

Module Contents#

Classes#

Data#

API#

wfexs_backend.pushers.b2share_export.INTROSPECT_VALIDATOR_MAPPER: Mapping[str, Type[jsonschema.validators._Validator]] = None#
class wfexs_backend.pushers.b2share_export.B2SHAREPublisher(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

See https://eudat.eu/services/userdoc/b2share-http-rest-api

Initialization

PLUGIN_NAME: ClassVar[SymbolicName] = 'cast(...)'#
ENABLED: ClassVar[bool] = True#
B2SHARE_API_PREFIX: Final[str] = 'https://b2share.eudat.eu/api/'#
SANDBOX_B2SHARE_API_PREFIX: Final[str] = 'https://trng-b2share.eudat.eu/api/'#
B2SHARE_DOI_PREFIX: Final[str] = '10.23728/b2share.'#
SANDBOX_B2SHARE_DOI_PREFIX: Final[str] = 'XXXX/b2share.'#
DEFAULT_B2SHARE_COMMUNITY: Final[str] = 'EUDAT'#
BANNED_SCHEMA_KEYS: Final[Sequence[str]] = ['$future_doi', 'owners']#
BANNED_PATCH_OPS_KEYS: Final[Sequence[str]] = None#
DEFAULT_DESCRIPTION_TYPE: Final[str] = 'TechnicalInfo'#
get_api_prefix() str#
get_community_metadata(community_id_or_name: str | None) Mapping[str, Any] | None#
_get_community_api_prefix(community_id: str) str#
_get_community_metadata(community_id: str) Mapping[str, Any]#

DEPRECATED

static __fetch_schema(schema_url: str) Tuple[str, Mapping[str, Any]]#
_get_community_schema(community_id: str) Tuple[str, Mapping[str, Any], str, str | None] | None#

It fetches the community schema

_get_entries_schema(community_id: str) Tuple[str, Mapping[str, Any], str]#

It fetches the community schema

_validate_community_schema(community_id: str, community_specific_metadata: Mapping[str, Any]) str | None#
_validate_entry_schema(community_id: str, entry_metadata: Mapping[str, Any]) None#
_get_records_prefix() str#
_get_query_params(include_credentials: bool, **kwargs: str) str#
_create_draft_record(metadata: Mapping[str, Any] | None = None, community_specific_metadata: Mapping[str, Any] | None = None, base_id: str | None = None, do_validate: bool = False, title: str | None = None, description: str | None = None, licences: Sequence[LicenceDescription] = [], resolved_orcids: Sequence[ResolvedORCID] = []) Mapping[str, Any]#
INTERNAL_ID_PAT: Final[re.Pattern[str]] = 'compile(...)'#
get_pid_metadata(pid: str) Mapping[str, Any] | None#
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#

It returns the publisher internal draft id, the public DOI / link, and the draft record representation

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_file_bucket_prefix(draft_entry: wfexs_backend.pushers.DraftEntry) str#

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

_get_record_prefix_from_record(record: Mapping[str, Any]) str#
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]#

It takes as input the draft record representation, a local filename and optionally the remote filename to use

static __update_meta(draft_record_metadata: Mapping[str, Any], metadata: Mapping[str, Any]) MutableMapping[str, Any]#

Generator of JSON Patch operations

classmethod __PatchOps(draft_record_metadata: Mapping[str, Any], metadata: Mapping[str, Any], prefix: str = '/') Sequence[Mapping[str, Any]]#

Generator of JSON Patch operations

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] = [], do_validate: bool = False) Mapping[str, Any]#

This method updates the (draft or not) record metadata, both the general one, and the specific of the community. This one could not make sense for some providers.

publish_draft_record(draft_entry: wfexs_backend.pushers.DraftEntry) Mapping[str, Any]#

This method publishes a draft record