-
Notifications
You must be signed in to change notification settings - Fork 7
Frequently Asked Questions
mspector edited this page Mar 14, 2018
·
8 revisions
Make sure you have installed openreview-py first by running pip install openreview-py
>>> import openreview
>>> client = openreview.Client(username='<your_email_address>', password='<your_password>',
>>> baseurl='https://openreview.net')
>>> iesl = client.get_group('iesl.cs.umass.edu')
>>> print iesl.members
[iesl.cs.umass.edu/Admin', u'~Andrew_McCallum1', u'~Melisa_Bok1']
>>> iesl = client.add_members_to_group(iesl, ['~Michael_Spector1', '[email protected]'])
>>> print iesl.members
['iesl.cs.umass.edu/Admin', u'~Andrew_McCallum1', u'~Melisa_Bok1', '~Michael_Spector1', '[email protected]']`
When you call "add_members_to_group", the second parameter is a list of group names to be added as members (to the Group object given in the first parameter).
In this example, notice that I have added both the username (~Michael_Spector1) and the email address ([email protected]) of the same user. This is redundant - you only need to add one or the other for the user to be considered a member. It's here to illustrate the fact that adding either will cause the user to be considered a member.
Important: You may add any email as a member, but don't add a user ID that doesn't exist yet.
You can remove members from a group in a similar way:
>>> iesl = client.remove_members_from_group(iesl, '[email protected]')
>>> print iesl.members
[iesl.cs.umass.edu/Admin', u'~Andrew_McCallum1', u'~Melisa_Bok1', '~Michael_Spector1']