Deposit

Zenodo deposit additions.

API

Deposit API.

zenodo.modules.deposit.api.PRESERVE_FIELDS = (u'_deposit', u'_buckets', u'_files', u'_internal', u'_oai', u'relations', u'owners', u'recid', u'conceptrecid', u'conceptdoi')

Fields which will not be overwritten on edit.

class zenodo.modules.deposit.api.ZenodoDeposit(data, model=None)[source]

Define API for changing deposit state.

clear(*args, **kwargs)[source]

Clear only drafts.

classmethod create(data, id_=None)[source]

Create a deposit.

Adds bucket creation immediately on deposit creation.

delete(self_or_cls, *args, **kwargs)[source]

Delete the deposit.

Parameters:delete_published (bool) – If True, even deposit of a published record will be deleted (usually used by admin operations).
static deposit_fetcher(record_uuid, data)

Fetch a deposit identifier.

static deposit_minter(record_uuid, data)

Mint the DEPID, and reserve the Concept RECID and RECID PIDs.

file_cls

alias of ZenodoFileObject

files_iter_cls

alias of ZenodoFilesIterator

has_minted_doi()[source]

Check if deposit has a minted DOI.

is_published()[source]

Check if deposit is published.

multipart_files

Get all multipart files.

newversion(pid=None)[source]

Create a new version deposit.

patch(*args, **kwargs)[source]

Patch only drafts.

publish(pid=None, id_=None, user_id=None, sip_agent=None)[source]

Publish the Zenodo deposit.

published_record_class

alias of ZenodoRecord

registerconceptdoi(pid=None)[source]

Register the conceptdoi for the deposit and record.

update(*args, **kwargs)[source]

Update only drafts.

validate_publish()[source]

Validate deposit.

Loaders

Deposit loaders.

zenodo.modules.deposit.loaders.deposit_json_v1(data=None)

JSON deposit record loader.

zenodo.modules.deposit.loaders.deposit_json_v1_translator(data)

JSON v1 deposit translator.

zenodo.modules.deposit.loaders.legacyjson_v1(data=None)

Legacy deposit JSON record loader.

zenodo.modules.deposit.loaders.legacyjson_v1_translator(data)

Legacy deposit dictionary translator.

Loaders for records.

zenodo.modules.deposit.loaders.base.json_loader(pre_validator=None, post_validator=None, translator=None)[source]

Basic JSON loader with translation and pre/post validation support.

zenodo.modules.deposit.loaders.base.marshmallow_loader(schema_class, **kwargs)[source]

Basic marshmallow loader generator.

Minters and fetchers

Persistent identifier fetchers.

zenodo.modules.deposit.fetchers.zenodo_deposit_fetcher(record_uuid, data)[source]

Fetch a deposit identifier.

Persistent identifier minters.

zenodo.modules.deposit.minters.zenodo_concept_recid_minter(record_uuid=None, data=None)[source]

Mint the Concept RECID.

Reserves the Concept RECID for the record.

zenodo.modules.deposit.minters.zenodo_deposit_minter(record_uuid, data)[source]

Mint the DEPID, and reserve the Concept RECID and RECID PIDs.

zenodo.modules.deposit.minters.zenodo_reserved_record_minter(record_uuid=None, data=None)[source]

Reserve a recid.

Indexing

Record modification prior to indexing.

zenodo.modules.deposit.indexer.index_versioned_record_siblings(sender, action=None, pid=None, deposit=None)[source]

Send previous version of published record for indexing.

zenodo.modules.deposit.indexer.indexer_receiver(sender, json=None, record=None, index=None, **dummy_kwargs)[source]

Connect to before_record_index signal to transform record for ES.

In order to avoid that a record and published deposit differs (e.g. if an embargo task updates the record), every time we index a record we also index the deposit and overwrite the content with that of the record.

Parameters:
  • sender – Sender of the signal.
  • json (invenio_records.api.Deposit) – JSON to be passed for the elastic search.
  • record (invenio_records.api.Deposit) – Indexed deposit record.
  • index (str) – Elasticsearch index name.

Search

Query factories for deposit REST API.

zenodo.modules.deposit.query.search_factory(*args, **kwargs)[source]

Check user is logged in and then parse.

Views

Redirects for legacy URLs.

zenodo.modules.deposit.views.current_datetime()[source]

Template contex processor which adds current datetime to the context.

zenodo.modules.deposit.views.current_openaire_ctx()[source]

Current OpenAIRE context.

zenodo.modules.deposit.views.default_view_method(pid, record, template=None)[source]

Default view method for updating record.

Sends record_viewed signal and renders template.

Parameters:
  • pid – PID object (‘depid’-type PID).
  • record – Record object (Deposit API).
  • template – Template to render.
zenodo.modules.deposit.views.delete(*args, **kwargs)[source]

Delete a record.

zenodo.modules.deposit.views.edit(*args, **kwargs)[source]

Edit a record.

zenodo.modules.deposit.views.legacy_index(*args, **kwargs)[source]

Legacy deposit.

zenodo.modules.deposit.views.new(*args, **kwargs)[source]

Create a new deposit.

zenodo.modules.deposit.views.newversion(*args, **kwargs)[source]

Create a new version of a record.

zenodo.modules.deposit.views.pass_record(action, deposit_cls=<class 'zenodo.modules.deposit.api.ZenodoDeposit'>)[source]

Pass record and deposit record to function.

zenodo.modules.deposit.views.registerconceptdoi(*args, **kwargs)[source]

Register the Concept DOI for the record.

zenodo.modules.deposit.views.to_files_js(deposit)[source]

List files in a deposit.

Get API links.

zenodo.modules.deposit.views.tombstone_errorhandler(error)[source]

Render tombstone page.

Errors

Deposit errors.

exception zenodo.modules.deposit.errors.MarshmallowErrors(errors)[source]

Marshmallow validation errors.

get_body(environ=None)[source]

Get the request body.

iter_errors(errors, prefix=u'')[source]

Iterator over marshmallow errors.

exception zenodo.modules.deposit.errors.MissingCommunityError(community_ids, *args, **kwargs)[source]

Error for invalid community IDs.

exception zenodo.modules.deposit.errors.MissingFilesError(errors=None, **kwargs)[source]

Error for when no files have been provided.

errors = [<invenio_rest.errors.FieldError object>]
exception zenodo.modules.deposit.errors.OngoingMultipartUploadError(errors=None, **kwargs)[source]

Error for when no files have been provided.

errors = [<invenio_rest.errors.FieldError object>]
exception zenodo.modules.deposit.errors.VersioningFilesError(errors=None, **kwargs)[source]

Error when new version’s files exist in one of the old versions.

errors = [<invenio_rest.errors.FieldError object>]