### Get All Invitations Source: https://openreview-py.readthedocs.io/en/latest/genindex Retrieves all invitations from the OpenReview system. This method is available on both openreview.api.OpenReviewClient and openreview.Client. ```Python from openreview.api import OpenReviewClient # Example usage: # client = OpenReviewClient(..., ...) # all_invitations = client.get_all_invitations() ``` ```Python from openreview import Client # Example usage: # client = Client(..., ...) # all_invitations = client.get_all_invitations() ``` -------------------------------- ### Get Process Logs Source: https://openreview-py.readthedocs.io/en/latest/genindex Retrieves process logs for a given invitation. This method is available on openreview.api.OpenReviewClient. ```Python from openreview.api import OpenReviewClient # Example usage: # client = OpenReviewClient(..., ...) # logs = client.get_process_logs(invitation_id=...) ``` ```Python from openreview import Client # Example usage: # client = Client(..., ...) # logs = client.get_process_logs(invitation_id=...) ``` -------------------------------- ### Initialize OpenReview Client Source: https://openreview-py.readthedocs.io/en/latest/api Initializes the OpenReviewClient with optional parameters for base URL, username, password, or token. Defaults are loaded from environment variables if not provided. ```Python client = openreview.api.OpenReviewClient(baseurl='https://api.openreview.net', username='user@example.com', password='password') ``` -------------------------------- ### Extract Subdomains from Email Source: https://openreview-py.readthedocs.io/en/latest/api Given an email address or a domain, this function returns a list of all its subdomains, starting from the most specific to the least specific. For example, 'user@mail.example.com' would yield ['mail.example.com', 'example.com']. ```Python openreview.tools.subdomains(_domain_) ``` -------------------------------- ### OpenReview Profile Class Constructor Source: https://openreview-py.readthedocs.io/en/latest/api Initializes a new Profile object with various optional parameters. ```Python class Profile: def __init__(self, _id=None, _active=None, _password=None, _number=None, _tcdate=None, _tmdate=None, _referent=None, _packaging=None, _invitation=None, _readers=None, _nonreaders=None, _signatures=None, _writers=None, _content=None, _metaContent=None, _tauthor=None, _state=None): """Initializes a Profile object. Parameters: _id (str, optional): Profile id _tcdate (int, optional): True creation date _tmdate (int, optional): Modification date _referent (str, optional): If this is a ref, it contains the Profile id that it points to _packaging (dict, optional): Contains previous versions of this Profile _invitation (str, optional): Invitation id _readers (str, optional): List of readers in the Invitation, each reader is a Group id _nonreaders (str, optional): List of nonreaders in the Invitation, each nonreader is a Group id _signatures (str, optional): List of signatures in the Invitation, each signature is a Group id _writers (str, optional): List of writers in the Invitation, each writer is a Group id _content (dict, optional): Dictionary containing the information of the Profile _metaContent (dict, optional): Contains information of the entities that have changed the Profile _active (bool, optional): If true, the Profile is active in OpenReview _password (bool, optional): If true, the Profile has a password, otherwise, it was automatically created and the person that it belongs to has not set a password yet _tauthor (str, optional): True author """ # Initialization logic would go here pass ``` -------------------------------- ### Get Attachment Source: https://openreview-py.readthedocs.io/en/latest/api Retrieves the binary content of an attachment using a note ID and the field name. If the attachment (e.g., a PDF) is not found, it returns an error message with a 404 status. The example shows how to save the retrieved content to a file. ```python get_attachment(_id_ , _field_name_) Example: >>> f = get_attachment(id='Place Note-ID here', field_name='pdf') >>> with open('output.pdf','wb') as op: op.write(f) ``` -------------------------------- ### Activate User with OpenReview Client Source: https://openreview-py.readthedocs.io/en/latest/api Activates a newly registered user by providing their activation token and profile content. Returns user information and an authentication token. ```Python res = client.activate_user('new@user.com', { 'names': [ { 'first': 'New', 'last': 'User', 'username': '~New_User1' } ], 'emails': ['new@user.com'], 'preferredEmail': 'new@user.com' }) ``` -------------------------------- ### Get OpenReview Groups Source: https://openreview-py.readthedocs.io/en/latest/api Retrieves a list of Group objects from OpenReview based on specified filters. Supports filtering by group ID, parent ID, regex matching, member, signatory, web field presence, and starting after a specific group ID. ```Python def get_all_groups(id=None, parent=None, regex=None, member=None, signatory=None, web=None, after=None): """Gets list of Group objects based on the filters provided. The Groups that will be returned match all the criteria passed in the parameters. Parameters: id (str, optional): id of the Group parent (str, optional): id of the parent Group regex (str, optional): Regex that matches several Group ids member (str, optional): Groups that contain this member signatory (str, optional): Groups that contain this signatory web (bool, optional): Groups that contain a web field value after (str, optional): Group id to start getting the list of groups from. Returns: List of Groups Return type: list[Group] """ pass ``` -------------------------------- ### Register New User in OpenReview Source: https://openreview-py.readthedocs.io/en/latest/api Registers a new user in the OpenReview system. Optional parameters include email, full name, and password. Returns a dictionary containing the new user's information. ```Python def register_user(_email =None_, _fullname =None_, _password =None_): """ Registers a new user Parameters: * **email** (_str_ _,__optional_) – email that will be used as id to log in after the user is registered * **fullname** (_str_ _,__optional_) – Full name of the user * **password** (_str_ _,__optional_) – Password used to log into OpenReview Returns: Dictionary containing the new user information including his id, username, email(s), readers, writers, etc. Return type: dict """ pass ``` -------------------------------- ### Get Expertise Results Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves the results of a completed expertise matching job using its job ID. It sends a GET request to the expertise results endpoint. ```Python def get_expertise_results(self, job_id, baseurl=None): base_url = baseurl if baseurl else self.baseurl response = self.session.get(base_url + '/expertise/results', params = {'jobId': job_id}, headers = self.headers) response = self.__handle_response(response) return response.json() ``` -------------------------------- ### Get Expertise Status Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves the status of an ongoing expertise matching job using its job ID. It sends a GET request to the expertise status endpoint. ```Python def get_expertise_status(self, job_id, baseurl=None): base_url = baseurl if baseurl else self.baseurl response = self.session.get(base_url + '/expertise/status', params = {'jobId': job_id}, headers = self.headers) response = self.__handle_response(response) return response.json() ``` -------------------------------- ### HTTP Session Setup with Retries - Python Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Configures an HTTP session with a retry strategy for handling network errors. It mounts adapters for HTTP and HTTPS protocols to manage connection retries. Uses the requests library. ```Python adapter = HTTPAdapter(max_retries=retry_strategy) self.session.mount('https://', adapter) self.session.mount('http://', adapter) ``` -------------------------------- ### Get Tilde Username Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Retrieves the next possible tilde username corresponding to a given full name. It makes a GET request to the tilde URL with the fullname as a parameter. ```Python def get_tildeusername(self, fullname): """ Gets next possible tilde user name corresponding to the specified full name :param fullname: Full name of the user :type fullname: str :return: next possible tilde user name corresponding to the specified full name :rtype: dict """ response = self.session.get(self.tilde_url, params = { 'fullname': fullname }, headers = self.headers) response = self.__handle_response(response) return response.json() ``` -------------------------------- ### Activate User in OpenReview Source: https://openreview-py.readthedocs.io/en/latest/api Activates a newly registered user by providing an activation token and user profile content. Returns user information and an authentication token. ```Python >>> res = client.activate_user('new@user.com', { 'names': [ { 'fullname': 'New User', 'username': '~New_User1' } ], 'emails': ['new@user.com'], 'preferredEmail': 'new@user.com' }) ``` -------------------------------- ### Initialize OpenReview Client Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Initializes the OpenReview client with a base URL and an optional authentication token. It sets up request headers, a session with retry logic, and handles token-based or username/password-based authentication. ```Python import sys import requests from requests.adapters import HTTPAdapter # Assuming LogRetry, HTTPAdapter, OpenReviewException, Profile, and jwt are defined elsewhere class OpenReviewClient: def __init__(self, baseurl, token=None, username=None, password=None, tokenExpiresIn=None): self.baseurl = baseurl self.note_edits_url = self.baseurl + '/notes/edits' self.invitation_edits_url = self.baseurl + '/invitations/edits' self.group_edits_url = self.baseurl + '/groups/edits' self.activatelink_url = self.baseurl + '/activatelink' self.domains_rename = self.baseurl + '/domains/rename' self.groups_members_cache_url = self.baseurl + '/groups/members/cache' self.user_agent = 'OpenReviewPy/v' + str(sys.version_info[0]) self.limit = 1000 self.token = token.replace('Bearer ', '') if token else None self.profile = None self.headers = { 'User-Agent': self.user_agent, 'Accept': 'application/json' } retry_strategy = LogRetry(total=3, backoff_factor=1, status_forcelist=[ 500, 502, 503, 504 ], respect_retry_after_header=True) self.session = requests.Session() adapter = HTTPAdapter(max_retries=retry_strategy) self.session.mount('https://', adapter) self.session.mount('http://', adapter) if self.token: self.headers['Authorization'] = 'Bearer ' + self.token self.user = jwt.decode(self.token, options={'verify_signature': False}) try: self.profile = self.get_profile() except: self.profile = None else: if not username: username = os.environ.get('OPENREVIEW_USERNAME') if not password: password = os.environ.get('OPENREVIEW_PASSWORD') if username or password: self.login_user(username, password, expiresIn=tokenExpiresIn) ``` -------------------------------- ### Get All Tags Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves all Tag objects matching the provided filters, similar to `get_tags` but designed for fetching potentially large sets of tags. It uses a concurrent get method for efficiency. ```Python def get_all_tags(self, id = None, invitation = None, forum = None, signature = None, tag = None, limit = None, offset = None, with_count=False): params = { 'id': id, 'invitation': invitation, 'forum': forum, 'signature': signature, 'tag': tag, 'limit': limit, 'offset': offset, 'with_count': with_count } return tools.concurrent_get(self, self.get_tags, **params) ``` -------------------------------- ### Get Tilde User Name Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves the next possible tilde user name based on a full name. It makes a GET request to the tilde URL with the provided fullname and handles the response. ```Python def get_tilde_user_name(self, fullname): """ Gets next possible tilde user name corresponding to the specified full name :param fullname: Full name of the user :type fullname: str :return: next possible tilde user name corresponding to the specified full name :rtype: dict """ response = self.session.get(self.tilde_url, params = { 'fullname': fullname }, headers = self.headers) response = self.__handle_response(response) return response.json() ``` -------------------------------- ### Invitation Class Initialization Source: https://openreview-py.readthedocs.io/en/latest/api This snippet details the initialization of the Invitation class, outlining all the parameters that can be set when creating a new invitation object. This includes IDs, readers, writers, invitees, signatures, reply templates, and various date/time fields. ```Python _class _openreview.Invitation(_id =None_, _readers =None_, _writers =None_, _invitees =None_, _signatures =None_, _reply =None_, _edit =None_, _super =None_, _noninvitees =None_, _nonreaders =None_, _web =None_, _web_string =None_, _process =None_, _process_string =None_, _preprocess =None_, _duedate =None_, _expdate =None_, _cdate =None_, _ddate =None_, _tcdate =None_, _tmdate =None_, _multiReply =None_, _taskCompletionCount =None_, _transform =None_, _bulk =None_, _reply_forum_views =[]_, _responseArchiveDate =None_, _details =None_) Parameters: * **id** (_str_) – Invitation id * **readers** (_list_ _[__str_ _]__,__optional_) – List of readers in the Invitation, each reader is a Group id * **writers** (_list_ _[__str_ _]__,__optional_) – List of writers in the Invitation, each writer is a Group id * **invitees** (_list_ _[__str_ _]__,__optional_) – List of invitees in the Invitation, each invitee is a Group id * **signatures** (_list_ _[__str_ _]__,__optional_) – List of signatures in the Invitation, each signature is a Group id * **reply** (_dict_ _,__optional_) – Template of the Note that will be created * **super** (_str_ _,__optional_) – Parent Invitation id * **noninvitees** (_list_ _[__str_ _]__,__optional_) – List of noninvitees in the Invitation, each noninvitee is a Group id * **nonreaders** (_list_ _[__str_ _]__,__optional_) – List of nonreaders in the Invitation, each nonreader is a Group id * **web** (_str_ _,__optional_) – Path to a file containing a webfield * **web_string** (_str_ _,__optional_) – String containing the webfield * **process** (_str_ _,__optional_) – Path to a file containing the process function * **process_string** (_str_ _,__optional_) – String containing the process function * **duedate** (_int_ _,__optional_) – Due date * **expdate** (_int_ _,__optional_) – Expiration date * **cdate** (_int_ _,__optional_) – Creation date ``` -------------------------------- ### OpenReview Client Initialization and API Endpoints Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Initializes the OpenReview API client, setting up the base URL, authentication credentials, and defining various API endpoint URLs. It also configures a custom retry strategy for network requests. ```Python #!/usr/bin/python from __future__ import absolute_import, division, print_function, unicode_literals import sys if sys.version_info[0] < 3: string_types = [str, unicode] else: string_types = [str] from . import tools import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry import pprint import os import re import jwt import traceback class OpenReviewException(Exception): pass class LogRetry(Retry): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def increment(self, method=None, url=None, response=None, error=None, _pool=None, _stacktrace=None): # Log retry information before calling the parent class method print(f"Retrying request: {method} {url}, response: {response}, error: {error}") # Call the parent class method to perform the actual retry increment return super().increment(method=method, url=url, response=response, error=error, _pool=_pool, _stacktrace=_stacktrace) [docs] class Client(object): """ :param baseurl: URL to the host, example: https://api.openreview.net (should be replaced by 'host' name). If none is provided, it defaults to the environment variable `OPENREVIEW_BASEURL` :type baseurl: str, optional :param username: OpenReview username. If none is provided, it defaults to the environment variable `OPENREVIEW_USERNAME` :type username: str, optional :param password: OpenReview password. If none is provided, it defaults to the environment variable `OPENREVIEW_PASSWORD` :type password: str, optional :param token: Session token. This token can be provided instead of the username and password if the user had already logged in :type token: str, optional :param tokenExpiresIn: Time in seconds before the token expires. This parameter only works when providing a username and a password. If none is set, the value will be set automatically to one day. The max value that it can be set to is 1 week. :type expiresIn: number, optional """ def __init__(self, baseurl = None, username = None, password = None, token= None, tokenExpiresIn=None): self.baseurl = baseurl if baseurl is not None else os.environ.get('OPENREVIEW_BASEURL', 'http://localhost:3000') if 'https://api2.openreview.net' in self.baseurl or 'https://devapi2.openreview.net' in self.baseurl: correct_baseurl = self.baseurl.replace('api2', 'api') raise OpenReviewException(f'Please use "{correct_baseurl}" as the baseurl for the OpenReview API or use the new client openreview.api.OpenReviewClient') self.groups_url = self.baseurl + '/groups' self.login_url = self.baseurl + '/login' self.register_url = self.baseurl + '/register' self.invitations_url = self.baseurl + '/invitations' self.mail_url = self.baseurl + '/mail' self.notes_url = self.baseurl + '/notes' self.tags_url = self.baseurl + '/tags' self.edges_url = self.baseurl + '/edges' self.bulk_edges_url = self.baseurl + '/edges/bulk' self.edges_count_url = self.baseurl + '/edges/count' self.edges_rename = self.baseurl + '/edges/rename' self.profiles_url = self.baseurl + '/profiles' self.profiles_search_url = self.baseurl + '/profiles/search' self.profiles_merge_url = self.baseurl + '/profiles/merge' self.profiles_rename = self.baseurl + '/profiles/rename' self.profiles_moderate = self.baseurl + '/profile/moderate' self.reference_url = self.baseurl + '/references' self.tilde_url = self.baseurl + '/tildeusername' self.pdf_url = self.baseurl + '/pdf' self.pdf_revisions_url = self.baseurl + '/references/pdf' self.messages_url = self.baseurl + '/messages' self.messages_direct_url = self.baseurl + '/messages/direct' self.process_logs_url = self.baseurl + '/logs/process' self.jobs_status = self.baseurl + '/jobs/status' self.institutions_url = self.baseurl + '/settings/institutions' self.venues_url = self.baseurl + '/venues' self.note_edits_url = self.baseurl + '/notes/edits' self.invitation_edits_url = self.baseurl + '/invitations/edits' self.infer_notes_url = self.baseurl + '/notes/infer' self.user_agent = 'OpenReviewPy/v' + str(sys.version_info[0]) self.domains_rename = self.baseurl + '/domains/rename' self.limit = 1000 self.token = token.replace('Bearer ', '') if token else None self.profile = None self.user = None self.headers = { 'User-Agent': self.user_agent, 'Accept': 'application/json', } retry_strategy = LogRetry(total=3, backoff_factor=0.1, status_forcelist=[ 500, 502, 503, 504 ], respect_retry_after_header=True) self.session = requests.Session() ``` -------------------------------- ### Get Message Requests Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Retrieves message requests based on an optional ID or invitation ID. It constructs query parameters for the GET request and returns a list of message requests from the API response. ```Python def get_message_requests(self, id=None, invitation=None): """ Posts a message to the recipients and consequently sends them emails :param id: ID of the message request :type id: str :param invitation: Invitation ID of the invitation that allows to send the message :type invitation: str :return: Contains the message request used to send the messages :rtype: dict """ params = {} if id: params['id'] = id if invitation: params['invitation'] = invitation if params: response = self.session.get(self.messages_requests_url, params=tools.format_params(params), headers = self.headers) response = self.__handle_response(response) return response.json()['requests'] else: return [] ``` -------------------------------- ### Register User - OpenReview API Source: https://openreview-py.readthedocs.io/en/latest/api Registers a new user with the OpenReview platform. Accepts optional email, full name, and password. Returns a dictionary containing the new user's information. ```python openreview.openreviewClient.register_user(_email=None_, _fullname=None_, _password=None_) ``` -------------------------------- ### Get Edges Count Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Fetches the count of edges matching the specified filters. It constructs a parameter dictionary from the input arguments and makes a GET request to the edges count URL, returning the 'count' from the JSON response. ```Python def get_edges_count(self, id = None, invitation = None, head = None, tail = None, label = None): """ Returns a list of Edge objects based on the filters provided. :arg id: a Edge ID. If provided, returns Edge whose ID matches the given ID. :arg invitation: an Invitation ID. If provided, returns Edges whose "invitation" field is this Invitation ID. :arg head: Profile ID of the Profile that is connected to the Note ID in tail :arg tail: Note ID of the Note that is connected to the Profile ID in head :arg label: Label ID of the match """ params = {} params['id'] = id params['invitation'] = invitation params['head'] = head params['tail'] = tail params['label'] = label response = self.session.get(self.edges_count_url, params=tools.format_params(params), headers = self.headers) response = self.__handle_response(response) count = response.json()['count'] return count ``` -------------------------------- ### Activate User - OpenReview API Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Activates a newly registered user using an activation token and profile content. It sends a PUT request to the activation endpoint. Dependencies include the requests library. ```Python def activate_user(self, token, content): """ Activates a newly registered user :param token: Activation token. If running in localhost, use email as token :type token: str :param content: Content of the profile to activate :type content: dict :return: Dictionary containing user information and the authentication token :rtype: dict Example: >>> res = client.activate_user('new@user.com', { 'names': [ { 'fullname': 'New User', 'username': '~New_User1' } ], 'emails': ['new@user.com'], 'preferredEmail': 'new@user.com' }) """ response = self.session.put(self.baseurl + '/activate/' + token, json = { 'content': content }, headers = self.headers) response = self.__handle_response(response) ``` -------------------------------- ### Get OpenReview Profiles by Relation Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves OpenReview profiles based on a specified relation. It makes a GET request to the profiles URL with the 'relation' parameter and returns a list of Profile objects derived from the API response. ```Python response = self.session.get(self.profiles_url, params = {'relation': relation }, headers = self.headers) response = self.__handle_response(response) return [Profile.from_json(p) for p in response.json()['profiles']] ``` -------------------------------- ### Activate User with OpenReview API Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Activates a newly registered user using an activation token and profile content. Returns user information and an authentication token. ```Python def activate_user(self, token, content): """ Activates a newly registered user :param token: Activation token. If running in localhost, use email as token :type token: str :param content: Content of the profile to activate :type content: dict :return: Dictionary containing user information and the authentication token :rtype: dict Example: >>> res = client.activate_user('new@user.com', { 'names': [ { 'first': 'New', 'last': 'User', 'username': '~New_User1' } ], 'emails': ['new@user.com'], 'preferredEmail': 'new@user.com' }) """ response = self.session.put(self.baseurl + '/activate/' + token, json = { 'content': content }, headers = self.headers) response = self.__handle_response(response) json_response = response.json() self.__handle_token(json_response) return json_response ``` -------------------------------- ### Get Single Note Edit by ID Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Retrieves a specific note edit using its unique identifier. This function makes a GET request to the note edits endpoint with the provided ID and trash status. ```Python def get_note_edit(self, id, trash=None): """ Get a single edit by id if available :param id: id of the edit :type id: str :return: edit matching the passed id :rtype: Note """ response = self.session.get(self.note_edits_url, params = {'id':id, 'trash': 'true' if trash == True else 'false'}, headers = self.headers) response = self.__handle_response(response) n = response.json()['edits'][0] return Edit.from_json(n) ``` -------------------------------- ### Create a New OpenReview Profile Source: https://openreview-py.readthedocs.io/en/latest/api The create_profile function creates a new user profile in OpenReview given an email, full name, and an optional super user. It returns the created Profile object. Dependencies include the openreview client. ```Python openreview.tools.create_profile(_client_ , _email_ , _fullname_ , _super_user ='openreview.net'_) ``` -------------------------------- ### Get References with Filters Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves a list of references from the OpenReview API based on specified filters such as referent, invitation, creation date, and original note status. It utilizes a concurrent get method for efficient data fetching. ```Python def get_references(self, referent=None, invitation=None, content=None, mintcdate=None, limit=None, offset=None, original=None, trash=None, with_count=False): params = { 'referent': referent, 'invitation': invitation, 'content': content, 'mintcdate': mintcdate, 'limit': limit, 'offset': offset, 'original': original, 'trash': trash, 'with_count': with_count } return tools.concurrent_get(self, self.get_references, **params) ``` -------------------------------- ### Get Jobs Status - OpenReview API Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Retrieves the status of jobs in the OpenReview queue. This function is intended for Super Users only. It makes a GET request to the jobs status endpoint and returns the status information as a JSON dictionary. ```Python def get_jobs_status(self): """ **Only for Super User**. Retrieves the jobs status of the queue :return: Jobs status :rtype: dict """ response = self.session.get(self.jobs_status, headers=self.headers) response = self.__handle_response(response) return response.json() ``` -------------------------------- ### Profile Class: Initialization Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Initializes a Profile object with various attributes including id, dates, referent, packaging, invitation details, readers, nonreaders, signatures, writers, content, metaContent, active status, password status, and author information. ```Python def __init__(self, id=None, active=None, password=None, number=None, tcdate=None, tmdate=None, referent=None, packaging=None, invitation=None, readers=None, nonreaders=None, signatures=None, writers=None, content=None, metaContent=None, tauthor=None, state=None): self.id = id self.number = number self.tcdate = tcdate self.tmdate = tmdate self.referent = referent self.packaging = packaging self.invitation = invitation self.readers = readers self.nonreaders = nonreaders self.signatures = signatures self.writers = writers self.content = content self.metaContent = metaContent self.active = active self.password = password if tauthor: self.tauthor = tauthor if state: self.state = state ``` -------------------------------- ### Get Single Group Edit by ID Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Retrieves a specific group edit using its unique identifier. This function makes a GET request to the group edits endpoint with the provided ID as a parameter and returns a single 'Edit' object. ```Python def get_group_edit(self, id): """ Get a single edit by id if available :param id: id of the edit :type id: str :return: edit matching the passed id :rtype: Group """ response = self.session.get(self.group_edits_url, params = {'id':id}, headers = self.headers) response = self.__handle_response(response) n = response.json()['edits'][0] return Edit.from_json(n) ``` -------------------------------- ### Invitation Class Initialization (Python) Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Initializes an Invitation object with various optional parameters for configuring invitations in OpenReview, such as readers, writers, invitees, and processing functions. ```Python class Invitation(object): """ :param id: Invitation id :type id: str :param readers: List of readers in the Invitation, each reader is a Group id :type readers: list[str], optional :param writers: List of writers in the Invitation, each writer is a Group id :type writers: list[str], optional :param invitees: List of invitees in the Invitation, each invitee is a Group id :type invitees: list[str], optional :param signatures: List of signatures in the Invitation, each signature is a Group id :type signatures: list[str], optional :param reply: Template of the Note that will be created :type reply: dict, optional :param super: Parent Invitation id :type super: str, optional :param noninvitees: List of noninvitees in the Invitation, each noninvitee is a Group id :type noninvitees: list[str], optional :param nonreaders: List of nonreaders in the Invitation, each nonreader is a Group id :type nonreaders: list[str], optional :param web: Path to a file containing a webfield :type web: str, optional :param web_string: String containing the webfield :type web_string: str, optional :param process: Path to a file containing the process function :type process: str, optional :param process_string: String containing the process function :type process_string: str, optional :param duedate: Due date :type duedate: int, optional :param expdate: Expiration date :type expdate: int, optional :param cdate: Creation date :type cdate: int, optional :param ddate: Deletion date :type ddate: int, optional :param tcdate: True creation date :type tcdate: int, optional :param tmdate: Modification date :type tmdate: int, optional :param multiReply: If true, allows for multiple Notes created from this Invitation (e.g. comments in a forum), otherwise, only one Note may be created (e.g. paper submission) :type multiReply: bool, optional :param taskCompletionCount: Keeps count of the number of times the Invitation has been used :type taskCompletionCount: int, optional :param transform: Path to a file that contains the transform function :type transform: str, optional :param details: :type details: dict, optional """ def __init__(self, id = None, readers = None, writers = None, invitees = None, signatures = None, reply = None, edit = None, super = None, noninvitees = None, nonreaders = None, web = None, web_string = None, process = None, process_string = None, preprocess = None, duedate = None, expdate = None, cdate = None, ddate = None, tcdate = None, tmdate = None, ``` -------------------------------- ### OpenReview Client Class Source: https://openreview-py.readthedocs.io/en/latest/_sources/api Documentation for the Client class in the openreview-py library. It details the members and functionalities available for interacting with the OpenReview API. ```Python from openreview import Client # Example usage (assuming client is initialized) # client = Client(..., ...) ``` -------------------------------- ### Get Invitation Edit by ID Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Fetches a specific invitation edit from the OpenReview API using its unique identifier. This method makes a GET request to the invitation edits endpoint, passing the ID as a parameter to retrieve the corresponding edit details. ```Python def get_invitation_edit(self, id): """ Get a single edit by id if available :param id: id of the edit :type id: str :return: edit matching the passed id :rtype: Note """ response = self.session.get(self.invitation_edits_url, params = {'id':id}, headers = self.headers) response = self.__handle_response(response) ``` -------------------------------- ### Create Profile Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/tools Creates a new user profile in OpenReview given an email and full name. It first checks if a profile with the email already exists and raises an exception if it does. It then creates associated username and email groups before posting the new profile. ```Python def create_profile(client, email, fullname, super_user='openreview.net'): """ Given email, first name, last name, and middle name (optional), creates a new profile. :param client: User that will create the Profile :type client: Client :param email: Preferred e-mail in the Profile :type email: str :param fullname: Full name of the user :type fullname: str :param super_user: Super user of the system :type super_user: str :return: The created Profile :rtype: Profile """ profile = get_profile(client, email) if profile: raise openreview.OpenReviewException('There is already a profile with this email address: {}'.format(email)) username_response = client.get_tildeusername(fullname) tilde_id = username_response['username'] tilde_group = openreview.api.Group(id=tilde_id, signatures=[client.profile.id], signatories=[tilde_id], readers=[tilde_id], writers=[client.profile.id], members=[email]) email_group = openreview.api.Group(id=email, signatures=[client.profile.id], signatories=[email], readers=[email], writers=[client.profile.id], members=[tilde_id]) profile_content = { 'emails': [email], 'preferredEmail': email, 'names': [ { 'fullname': fullname, 'username': tilde_id } ], } client.post_group_edit( f'{super_user}/-/Username', signatures=[super_user], readers=[tilde_id], writers=[super_user], group=tilde_group ) client.post_group_edit( f'{super_user}/-/Email', signatures=[super_user], readers=[tilde_id], writers=[super_user], group=email_group ) profile = client.post_profile(openreview.Profile(id=tilde_id, content=profile_content, signatures=[tilde_id])) return profile ``` -------------------------------- ### Get Tag by ID Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves a single tag from the OpenReview API by its ID. The method performs a GET request to the tags endpoint, handles the response, and returns a `Tag` object. It depends on the `Tag` class for parsing the JSON response and the `session` object for API communication. ```Python def get_tag(self, id): """ Get a single Tag by id if available :param id: id of the Tag :type id: str :return: Tag with the Tag information :rtype: Tag """ response = self.session.get(self.tags_url, params = {'id': id}, headers = self.headers) response = self.__handle_response(response) t = response.json()['tags'][0] return Tag.from_json(t) ``` -------------------------------- ### Get Invitation by ID Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Retrieves a specific invitation from the OpenReview API using its ID. The method makes a GET request to the invitations endpoint, handles the response, and returns an `Invitation` object. It relies on the `Invitation` class for parsing the JSON response and the `session` object for communication. ```Python def get_invitation(self, id): """ Get a single invitation by id if available :param id: id of the invitation :type id: str :return: Invitation matching the passed id :rtype: Invitation """ response = self.session.get(self.invitations_url, params = {'id': id}, headers = self.headers) response = self.__handle_response(response) i = response.json()['invitations'][0] return Invitation.from_json(i) ``` -------------------------------- ### Get Comprehensive Profile Information (Python) Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/tools Initializes sets for domains, emails, relations, and publications, and calculates a cutoff year if n_years is provided. This function is intended to gather all profile-related information. ```Python def get_comprehensive_profile_info(profile, n_years=None): """ Gets all the domains, emails, relations associated with a Profile :param profile: Profile from which all the relations will be obtained :type profile: Profile :param n_years: Number of years to consider when getting the profile information :type n_years: int, optional :return: Dictionary with the domains, emails, and relations associated with the passed Profile :rtype: dict """ domains = set() emails = set() relations = set() publications = set() if n_years: cut_off_date = datetime.datetime.now() ``` -------------------------------- ### Get Venues Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Fetches a list of venues based on provided filters such as a single venue ID, a list of venue IDs, or a list of invitation IDs. It formats the parameters and makes a GET request to the venues endpoint, returning the list of venues from the JSON response. ```Python params = {} if id is not None: params['id'] = id if ids is not None: params['ids'] = ','.join(ids) if invitations is not None: params['invitations'] = ','.join(invitations) response = self.session.get(self.venues_url, params=tools.format_params(params), headers=self.headers) response = self.__handle_response(response) return response.json()['venues'] ``` -------------------------------- ### Register User with OpenReview API Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/api/client Registers a new user in OpenReview. Requires email, fullname, and password. Returns a dictionary with the new user's information. ```Python def register_user(self, email = None, fullname = None, password = None): """ Registers a new user :param email: email that will be used as id to log in after the user is registered :type email: str, optional :param fullname: Full name of the user :type fullname: str, optional :param password: Password used to log into OpenReview :type password: str, optional :return: Dictionary containing the new user information including his id, username, email(s), readers, writers, etc. :rtype: dict """ register_payload = { 'email': email, 'fullname': fullname, 'password': password } response = self.session.post(self.register_url, json = register_payload, headers = self.headers) response = self.__handle_response(response) return response.json() ``` -------------------------------- ### Login User Source: https://openreview-py.readthedocs.io/en/latest/api Logs in a registered user with the provided username and password. An optional expiration time for the token can be specified. Returns a dictionary containing user information and the authentication token. ```Python def login_user(_username =None_, _password =None_, _expiresIn =None_): """ Logs in a registered user Parameters: username (str, optional): OpenReview username password (str, optional): OpenReview password expiresIn (number, optional): Time in seconds before the token expires. If none is set the value will be set automatically to one hour. The max value that it can be set to is 1 week. Returns: Dictionary containing user information and the authentication token Return type: dict """ pass ``` -------------------------------- ### Get Note by ID Source: https://openreview-py.readthedocs.io/en/latest/_modules/openreview/openreview Fetches a single note from the OpenReview API using its unique identifier. The method sends a GET request to the notes endpoint, processes the response, and returns a `Note` object. It requires the `Note` class for deserialization and the `session` object for making the API call. ```Python def get_note(self, id): """ Get a single Note by id if available :param id: id of the note :type id: str :return: Note matching the passed id :rtype: Note """ response = self.session.get(self.notes_url, params = {'id':id}, headers = self.headers) response = self.__handle_response(response) n = response.json()['notes'][0] return Note.from_json(n) ``` -------------------------------- ### Create Profile - OpenReview Tools Source: https://openreview-py.readthedocs.io/en/latest/genindex Creates a user profile. This function is part of the openreview.tools module. ```python openreview.tools.create_profile() ```