deposit.osf.protocol module

class deposit.osf.protocol.OSFProtocol(repository, **kwargs)[source]

Bases: deposit.protocol.RepositoryProtocol

A protocol to submit using the OSF REST API.

add_contributors(authors)[source]
create_license(authors)[source]
create_node(abstract, tags, authors)[source]
create_preprint(pf_path, records, subjects)[source]
create_subjects(form)[source]
create_tags(form)[source]
form_class

alias of OSFForm

get_bound_form(data)[source]

(Rewrite the method from RepositoryProtocol.) Submit a paper to the repository. This is expected to raise DepositError if something goes wrong.

Parameters:
  • pdf – Filename to the PDF file to submit
  • form – The form returned by get_form and completed by the user.
  • dry_run – if True, should
Returns:

a DepositResult object.

get_form()[source]

(Rewrite the method from RepositoryProtocol.) Returns a bound version of the form, with the given data. Here, data is expected to come from a POST request generated by the user, ready for validation.

get_form_initial_data()[source]
get_key_data(key, records)[source]
get_newnode_osf_storage(node_id)[source]
get_primary_data(form)[source]
init_deposit(paper, user)[source]

Refuse deposit when the paper is already on OSF.

mask_dissemin_contributor()[source]

Mark the dissemin account as non-bibliographic contributor, so that it does not appear as author of the preprint

preferences_form_class

alias of OSFPreferencesForm

preferences_model

alias of OSFDepositPreferences

submit_deposit(pdf, form, dry_run=False)[source]
translate_author(dissemin_author, goal=u'optional')[source]
update_preprint_license(authors, preprint_id)[source]