Deposit

Zenodo deposit additions.

API

Deposit API.

zenodo.modules.deposit.api.PRESERVE_FIELDS = ('_deposit', '_files', '_internal', '_oai', 'owners', 'recid')

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.

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

Delete the deposit.

file_cls

alias of ZenodoFileObject

has_minted_doi()[source]

Check if deposit has a minted DOI.

is_published()[source]

Check if deposit is published.

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

Patch only drafts.

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

Publish the Zenodo deposit.

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

Update only drafts.

validate_publish()[source]

Validate deposit.

class zenodo.modules.deposit.api.ZenodoFileObject(obj, data)[source]

Zenodo file object.

dumps()[source]

Create a dump.

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_deposit_minter(record_uuid, data)[source]

Mint deposit identifier.

Indexing

Record modification prior to 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.legacy_index()[source]

Legacy deposit.

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='')[source]

Iterator over marshmallow errors.

exception zenodo.modules.deposit.errors.MissingCommunityError(community_ids)[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>]