OpenReview Python Library
The OpenReview Python library, often referred to as openreview-py, serves as a convenient tool for developers and researchers to interact with the OpenReview system, a platform crucial for managing academic conferences and paper submissions.
Prerequisites
Before diving into the installation and usage of the openreview-py library, it’s important to know that this library requires Python version 3.6 or newer. Users still operating on Python 2.7 will need to upgrade, as it is no longer supported by this library.
Installation
Installing the OpenReview Python library is flexible, offering two main approaches:
-
Via
pip
:- The simplest method is using Python's package manager, pip. Just open your terminal and run:
pip install openreview-py
- The simplest method is using Python's package manager, pip. Just open your terminal and run:
-
From the Repository:
-
For those who prefer to directly access and install it from the source, the following steps should be taken:
git clone https://github.com/openreview/openreview-py.git cd openreview-py pip install -e .
-
Note: Depending on your Python setup, you may need to switch
pip
withpip3
.
-
Usage
The openreview-py library is a potent tool that allows users to fetch and manipulate data from the OpenReview system. Here's a simple example of how it can be used to retrieve titles of papers submitted to the ICLR 2019 conference:
import openreview
client = openreview.Client(baseurl='https://api.openreview.net', username='<your username>', password='<your password>')
notes = openreview.tools.iterget_notes(client, invitation='ICLR.cc/2019/Conference/-/Blind_Submission')
for note in notes:
print(note.content['title'])
For comprehensive documentation and additional examples, users can refer to the official reference or the OpenReview docs.
Test Setup
Running tests on the openreview-py library involves a series of setup steps to ensure everything is primed for success:
-
Clone and Configure the Required Services:
- OpenReview API V1, OpenReview API V2, and OpenReview Web front-end need to be cloned and configured to operate on ports 3000, 3001, and 3030, respectively. Detailed setup instructions are available in each project's README file:
-
Install Testing Dependencies:
- The
pytest
,pytest-selenium
, andpytest-cov
packages must be installed via pip:pip install pytest pytest-selenium pytest-cov
- The
-
Selenium Driver Setup:
- Download the appropriate Firefox Selenium driver for your operating system from GitHub and place the
geckodriver
executable into theopenreview-py/tests/drivers
directory.
- Download the appropriate Firefox Selenium driver for your operating system from GitHub and place the
The directory structure should resemble:
├── openreview-py
│ ├── tests
│ │ ├── data
│ │ ├── drivers
│ │ │ └── geckodriver
Running Tests
After the test setup, users can proceed with running the test suite:
-
Start both OpenReview API versions:
-
For OpenReview API V1, execute:
npm run cleanStart
-
For OpenReview API V2, execute:
npm run cleanStart
-
-
For the OpenReview Web, run:
SUPER_USER=openreview.net npm run dev
-
Once all services are operational, execute the tests using:
pytest
-
To prevent environment variable conflicts, ensure that any OpenReview credentials previously set are cleared before test execution:
unset OPENREVIEW_USERNAME && unset OPENREVIEW_PASSWORD
-
Running a specific test can be done by specifying the file name, such as:
pytest tests/test_double_blind_conference.py
The OpenReview Python library is a robust tool for managing and accessing data within the OpenReview ecosystem, making it indispensable for users involved in academic conference management.