API Documentation¶
Client¶
-
class
openreview.Client(baseurl=None, username=None, password=None, token=None)[source]¶ -
activate_user(token, content)[source]¶ Activates a newly registered user
Parameters: - token – activation token
- content – content of the profile to activate
Example Usage: >>> res = client.activate_user(‘new@user.com’, {
- ‘names’: [
- {
- ‘first’: ‘New’, ‘last’: ‘User’, ‘username’: ‘~New_User1’
}
],
‘emails’: [‘new@user.com’], ‘preferredEmail’: ‘new@user.com’ })
-
add_members_to_group(group, members)[source]¶ - Adds members to a groupMembers should be in a string, unicode or a list format
-
delete_note(note)[source]¶ Deletes the note and returns a {status = ‘ok’} in case of a successful deletion and an OpenReview exception otherwise.
-
get_groups(id=None, regex=None, member=None, host=None, signatory=None, limit=None, offset=None)[source]¶ Returns a list of Group objects based on the filters provided.
-
get_invitations(id=None, invitee=None, replytoNote=None, replyForum=None, signature=None, note=None, regex=None, tags=None, limit=None, offset=None, minduedate=None, duedate=None, pastdue=None, replyto=None, details=None)[source]¶ Returns a list of Invitation objects based on the filters provided.
-
get_notes(id=None, paperhash=None, forum=None, invitation=None, replyto=None, tauthor=None, signature=None, writer=None, trash=None, number=None, content=None, limit=None, offset=None, mintcdate=None, details=None)[source]¶ Returns a list of Note objects based on the filters provided.
Parameters: - id – a Note ID. If provided, returns Notes whose ID matches the given ID.
- paperhash – a “paperhash” for a note. If provided, returns Notes whose paperhash matches this argument. (A paperhash is a human-interpretable string built from the Note’s title and list of authors to uniquely identify the Note)
- forum – a Note ID. If provided, returns Notes whose forum matches the given ID.
- invitation – an Invitation ID. If provided, returns Notes whose “invitation” field is this Invitation ID.
- replyto – a Note ID. If provided, returns Notes whose replyto field matches the given ID.
- tauthor – a Group ID. If provided, returns Notes whose tauthor field (“true author”) matches the given ID, or is a transitive member of the Group represented by the given ID.
- signature – a Group ID. If provided, returns Notes whose signatures field contains the given Group ID.
- writer – a Group ID. If provided, returns Notes whose writers field contains the given Group ID.
- trash – a Boolean. If True, includes Notes that have been deleted (i.e. the ddate field is less than the current date)
- number – an integer. If present, includes Notes whose number field equals the given integer.
- content – a dictionary. If present, includes Notes whose each key is present in the content field and it is equals the given value.
- mintcdate – an integer representing an Epoch time timestamp, in milliseconds. If provided, returns Notes whose “true creation date” (tcdate) is at least equal to the value of mintcdate.
- details – TODO: What is a valid value for this field?
-
get_pdf(id)[source]¶ Returns the binary content of a pdf using the provided note id If the pdf is not found then this returns an error message with “status”:404
Example Usage:
>>> f = get_pdf(id='Place Note-ID here') >>> with open('output.pdf','wb') as op: op.write(f)
-
get_profiles(email_or_id_list=None, id=None, email=None, first=None, middle=None, last=None)[source]¶ - If the list is tilde_ids, returns an array of profilesIf the list is emails, returns an array of dictionaries with ‘email’ and ‘profile’
-
get_references(referent=None, invitation=None, mintcdate=None, limit=None, offset=None, original=False)[source]¶ Returns a list of revisions for a note.
Parameters: - referent – a Note ID. If provided, returns references whose “referent” value is this Note ID.
- invitation – an Invitation ID. If provided, returns references whose “invitation” field is this Invitation ID.
- mintcdate – an integer representing an Epoch time timestamp, in milliseconds. If provided, returns references whose “true creation date” (tcdate) is at least equal to the value of mintcdate.
- original – a boolean. If True then get_references will additionally return the references to the original note.
Returns a list of Tag objects based on the filters provided.
Parameters: - id – a Tag ID. If provided, returns Tags whose ID matches the given ID.
- forum – a Note ID. If provided, returns Tags whose forum matches the given ID.
- invitation – an Invitation ID. If provided, returns Tags whose “invitation” field is this Invitation ID.
-
get_tildeusername(first, last, middle=None)[source]¶ - Returns next possible tilde user name corresponding to the specified first, middle and last nameFirst and last names are required, while middle name is optional
-
login_user(username=None, password=None)[source]¶ Logs in a registered user and returns authentication token
-
post_group(group, overwrite=True)[source]¶ - Posts the group. Upon success, returns the posted Group object.If the group is unsigned, signs it using the client’s default signature.
-
post_invitation(invitation)[source]¶ - Posts the invitation. Upon success, returns the posted Invitation object.If the invitation is unsigned, signs it using the client’s default signature.
-
post_note(note)[source]¶ - Posts the note. Upon success, returns the posted Note object.If the note is unsigned, signs it using the client’s default signature
-
put_pdf(fname)[source]¶ Uploads a pdf to the openreview server and returns a relative url for the uploaded pdf
Parameters: fname – path to the pdf
-
register_user(email=None, first=None, last=None, middle='', password=None)[source]¶ Registers a new user
-
remove_members_from_group(group, members)[source]¶ - Removes members from a groupMembers should be in a string, unicode or a list format
-
-
class
openreview.Group(id, readers, writers, signatories, signatures, cdate=None, ddate=None, members=None, nonreaders=None, web=None)[source]¶
-
class
openreview.Invitation(id, readers=None, writers=None, invitees=None, signatures=None, reply=None, super=None, noninvitees=None, nonreaders=None, web=None, process=None, process_string=None, duedate=None, expdate=None, cdate=None, rdate=None, ddate=None, tcdate=None, tmdate=None, multiReply=None, taskCompletionCount=None, transform=None, details=None)[source]¶
-
class
openreview.Note(invitation, readers, writers, signatures, content, id=None, original=None, number=None, cdate=None, tcdate=None, tmdate=None, ddate=None, forum=None, referent=None, replyto=None, nonreaders=None, details=None, tauthor=None)[source]¶
-
class
openreview.Tag(tag, invitation, readers, signatures, id=None, cdate=None, tcdate=None, ddate=None, forum=None, replyto=None, nonreaders=None)[source]¶
Tools¶
-
tools.add_assignment(client, paper_number, conference, reviewer, parent_group_params={}, individual_group_params={}, parent_label='Reviewers', individual_label='AnonReviewer', use_profile=True)[source]¶ - Assigns a reviewer to a paper.Also adds the given user to the parent and individual groups defined by the paper number, conference, and labels“individual groups” are groups with a single member;e.g. conference.org/Paper1/AnonReviewer1“parent group” is the group that contains the individual groups;e.g. conference.org/Paper1/Reviewers
Parameters: - paper_number – the number of the paper to assign
- conference – the ID of the conference being assigned
- reviewer – may be an email address or a tilde ID;
- parent_group_params – optional parameter that overrides the default
- individual_group_params – optional parameter that overrides the default
-
tools.assign(client, paper_number, conference, parent_group_params={}, individual_group_params={}, reviewer_to_add=None, reviewer_to_remove=None, parent_label='Reviewers', individual_label='AnonReviewer', use_profile=True)[source]¶ DEPRECATED as of openreview-py revision 0.9.5
Either assigns or unassigns a reviewer to a paper. TODO: Is this function really necessary?
“individual groups” are groups with a single member; e.g. conference.org/Paper1/AnonReviewer1 “parent group” is the group that contains the individual groups; e.g. conference.org/Paper1/Reviewers
Parameters: - paper_number – the number of the paper to assign
- conference – the ID of the conference being assigned
- parent_group_params – optional parameter that overrides the default
- individual_group_params – optional parameter that overrides the default
- reviewer_to_add – may be an email address or a tilde ID; adds the given user to the parent and individual groups defined by the paper number, conference, and labels
- reviewer_to_remove – same as @reviewer_to_add, but removes the user
It’s important to remove any users first, so that we can do direct replacement of one user with another.
For example: passing in a reviewer to remove AND a reviewer to add should replace the first user with the second.
-
tools.build_groups(conference_group_id, default_params=None)[source]¶ Given a group ID, returns a list of empty groups that correspond to the given group’s subpaths
(e.g. Test.com, Test.com/TestConference, Test.com/TestConference/2018)
>>> [group.id for group in build_groups('ICML.cc/2019/Conference')] [u'ICML.cc', u'ICML.cc/2019', u'ICML.cc/2019/Conference']
-
tools.create_profile(client, email, first, last, middle=None, allow_duplicates=False)[source]¶ Given email, first name, last name, and middle name (optional), creates and returns a user profile.
If a profile with the same name exists, and allow_duplicates is False, an exception is raised.
If a profile with the same name exists and allow_duplicates is True, a profile is created with the next largest number (e.g. if ~Michael_Spector1 exists, ~Michael_Spector2 will be created)
-
tools.fill_template(template, paper)[source]¶ Fills an openreview “template” with the corresponding values from an openreview.Note object. Templates are dicts that match the schema of any OpenReview object class .
Example: group_template = {
‘id’: ‘Conf.org/2019/Paper<number>’, ‘members’: [‘Conf.org/2019/Paper<number>/Reviewers’]}
Parameters: template – a dict that matches the schema of an OpenReview Groupor
Invitationwith any number of wildcards in the form of “<attr>”, where “attr” is an attribute in theNoteclass. :arg paper: an instance ofNoteclass, to fill the template values.
-
tools.get_all_venues(client)[source]¶ Returns a list of all the venues
Parameters: client – Object of Clientclass
-
tools.get_bibtex(note, venue_fullname, year, url_forum=None, accepted=False, anonymous=True)[source]¶ Generates a bibtex field for a given Note.
The “accepted” argument is used to indicate whether or not the paper was ultimately accepted. (OpenReview generates bibtex fields for rejected papers)
The “anonymous” argument is used to indicate whether or not the paper’s authors should be revealed.
Warning: this function is a work-in-progress.
-
tools.get_paper_conflicts(client, paper)[source]¶ Given a Note object representing a submitted paper, returns a tuple containing two sets: domain_conflicts and relation_conflicts.
domain_conflicts is a set of domains/subdomains that may have a conflict of interest with the given paper.
relation_conflicts is a set of group IDs (email addresses or profiles) that may have a conflict of interest with the given paper.
Automatically ignores domain conflicts with “gmail.com”.
-
tools.get_paperhash(first_author, title)[source]¶ Returns the paperhash of a paper, given the title and first author.
>>> get_paperhash('David Soergel', 'Open Scholarship and Peer Review: a Time for Experimentation') u'soergel|open_scholarship_and_peer_review_a_time_for_experimentation'
-
tools.get_preferred_name(profile)[source]¶ Returns a string representing the user’s preferred name, if available, or the first listed name if not available.
Accepts openreview.Profile object
-
tools.get_profile_conflicts(client, reviewer_to_add)[source]¶ Helper function for profile_conflicts function. Given a reviewer ID or email address, requests the server for that reviewer’s profile, and checks it for conflicts using profile_conflicts.
-
tools.get_reviewer_groups(client, paper_number, conference, group_params, parent_label, individual_label)[source]¶ This is only intended to be used as a local helper function
Parameters: - paper_number – the number of the paper to assign
- conference – the ID of the conference being assigned
- group_params – optional parameter that overrides the default
-
tools.get_submission_invitations(client, open_only=False)[source]¶ Returns a list of invitation ids visible to the client according to the value of parameter “open_only”.
Parameters: - client – Object of
Clientclass - open_only – Default value is False. This is a boolean param with value True implying that the results would be invitations having a future due date.
Example Usage:
>>> get_submission_invitations(c,True) [u'machineintelligence.cc/MIC/2018/Conference/-/Submission', u'machineintelligence.cc/MIC/2018/Abstract/-/Submission', u'ISMIR.net/2018/WoRMS/-/Submission', u'OpenReview.net/Anonymous_Preprint/-/Submission']
- client – Object of
-
tools.iterget_groups(client, id=None, regex=None, member=None, host=None, signatory=None)[source]¶ Returns an iterator over groups, filtered by the provided parameters, ignoring API limit.
Parameters: - client – an openreview.Client object.
- id – a Note ID. If provided, returns groups whose “id” value is this Group ID.
- regex – a regular expression string to match Group IDs. If provided, returns groups whose “id” value matches the given regex.
- member – a string. Essentially, members field contains Group Ids that are members of this Group object. If provided, returns groups whose “members” field contains the given string.
-
tools.iterget_invitations(client, id=None, invitee=None, regex=None, tags=None, minduedate=None, duedate=None, pastdue=None, replytoNote=None, replyForum=None, signature=None, note=None, replyto=None, details=None)[source]¶ Returns an iterator over invitations, filtered by the provided parameters, ignoring API limit.
Parameters: - client – an openreview.Client object.
- id – an Invitation ID. If provided, returns invitations whose “id” value is this Invitation ID.
- invitee – a string. Essentially, invitees field in an Invitation object contains Group Ids being invited using the invitation. If provided, returns invitations whose “invitee” field contains the given string.
- regex – a regular expression string to match Invitation IDs. If provided, returns invitations whose “id” value matches the given regex.
-
tools.iterget_notes(client, id=None, paperhash=None, forum=None, invitation=None, replyto=None, tauthor=None, signature=None, writer=None, trash=None, number=None, mintcdate=None, content=None, details=None)[source]¶ Returns an iterator over Notes, filtered by the provided parameters, ignoring API limit.
Parameters: - client – an openreview.Client object.
- id – a Note ID. If provided, returns Notes whose ID matches the given ID.
- paperhash – a “paperhash” for a note. If provided, returns Notes whose paperhash matches this argument. (A paperhash is a human-interpretable string built from the Note’s title and list of authors to uniquely identify the Note)
- forum – a Note ID. If provided, returns Notes whose forum matches the given ID.
- invitation – an Invitation ID. If provided, returns Notes whose “invitation” field is this Invitation ID.
- replyto – a Note ID. If provided, returns Notes whose replyto field matches the given ID.
- tauthor – a Group ID. If provided, returns Notes whose tauthor field (“true author”) matches the given ID, or is a transitive member of the Group represented by the given ID.
- signature – a Group ID. If provided, returns Notes whose signatures field contains the given Group ID.
- writer – a Group ID. If provided, returns Notes whose writers field contains the given Group ID.
- trash – a Boolean. If True, includes Notes that have been deleted (i.e. the ddate field is less than the current date)
- number – an integer. If present, includes Notes whose number field equals the given integer.
- mintcdate – an integer representing an Epoch time timestamp, in milliseconds. If provided, returns Notes whose “true creation date” (tcdate) is at least equal to the value of mintcdate.
- content – a dictionary. If present, includes Notes whose each key is present in the content field and it is equals the given value.
- details – TODO: What is a valid value for this field?
-
tools.iterget_references(client, referent=None, invitation=None, mintcdate=None)[source]¶ Returns an iterator over references, filtered by the provided parameters, ignoring API limit.
Parameters: - client – an openreview.Client object.
- referent – a Note ID. If provided, returns references whose “referent” value is this Note ID.
- invitation – an Invitation ID. If provided, returns references whose “invitation” field is this Invitation ID.
- mintcdate – an integer representing an Epoch time timestamp, in milliseconds. If provided, returns references whose “true creation date” (tcdate) is at least equal to the value of mintcdate.
Returns an iterator over Tags, filtered by the provided parameters, ignoring API limit.
Example: iterget_tags(client, invitation=’MyConference.org/-/Bid_Tags’)
Parameters: - id – a Tag ID. If provided, returns Tags whose ID matches the given ID.
- forum – a Note ID. If provided, returns Tags whose forum matches the given ID.
- invitation – an Invitation ID. If provided, returns Tags whose “invitation” field is this Invitation ID.
-
tools.next_individual_suffix(unassigned_individual_groups, individual_groups, individual_label)[source]¶ - “individual groups” are groups with a single member;e.g. conference.org/Paper1/AnonReviewer1
Parameters: - unassigned_individual_groups – a list of individual groups with no members
- individual_groups – the full list of individual groups, empty or not
- individual_label – the “label” of the group: e.g. “AnonReviewer”
Returns: an individual group’s suffix (e.g. AnonReviewer1)
The suffix will be the next available empty group,
or will be the suffix of the largest indexed group +1
-
tools.post_group_parents(client, group, overwrite_parents=False)[source]¶ Helper function for posting groups created by build_groups function.
Recommended that this function be deprecated.
-
tools.post_submission_groups(client, conference_id, submission_invite, chairs)[source]¶ Create paper group, authors group, reviewers group, review non-readers group for all notes returned by the submission_invite.
-
tools.profile_conflicts(profile)[source]¶ Given a profile, returns a tuple containing two sets: domain_conflicts and relation_conflicts.
domain_conflicts is a set of domains/subdomains that may have a conflict of interest with the given profile.
relation_conflicts is a set of group IDs (email addresses or profiles) that may have a conflict of interest with the given profile.
-
tools.recruit_reviewer(client, user, first, hash_seed, recruit_reviewers_id, recruit_message, recruit_message_subj, reviewers_invited_id, verbose=True)[source]¶ Recruit a reviewer. Sends an email to the reviewer with a link to accept or reject the recruitment invitation.
Parameters: - hash_seed – a random number for seeding the hash.
- recruit_message – a formattable string containing the following string variables: (name, accept_url, decline_url)
- recruit_message_subj – subject line for the recruitment email
- reviewers_invited_id – group ID for the “Reviewers Invited” group, often used to keep track of which reviewers have already been emailed.
-
tools.remove_assignment(client, paper_number, conference, reviewer, parent_group_params={}, parent_label='Reviewers', individual_label='AnonReviewer')[source]¶ - Un-assigns a reviewer from a paper.Removes the given user from the parent group, and any assigned individual groups.“individual groups” are groups with a single member;e.g. conference.org/Paper1/AnonReviewer1“parent group” is the group that contains the individual groups;e.g. conference.org/Paper1/Reviewers
Parameters: - paper_number – the number of the paper to assign
- conference – the ID of the conference being assigned
- reviewer – same as @reviewer_to_add, but removes the user
- parent_group_params – optional parameter that overrides the default
- individual_group_params – optional parameter that overrides the default
-
tools.replace_members_with_ids(client, group)[source]¶ Given a Group object, iterates through the Group’s members and, for any member represented by an email address, attempts to find a profile associated with that email address. If a profile is found, replaces the email with the profile ID.
Returns None.
-
tools.subdomains(domain)[source]¶ Given an email address, returns a list with the domains and subdomains.
>>> subdomains('johnsmith@iesl.cs.umass.edu') [u'iesl.cs.umass.edu', u'cs.umass.edu', u'umass.edu']
-
tools.timestamp_GMT(year, month, day, hour=0, minute=0, second=0)[source]¶ Given year, month, day, and (optionally) hour, minute, second in GMT time zone: returns the number of milliseconds between this day and Epoch Time (Jan 1, 1970).
>>> timestamp_GMT(1990, 12, 20, hour=12, minute=30, second=24) 661696224000