esReven Project Manager

Table of content

Reven Python API installation guide

The Reven Python API can be used:

This page will detail the three use cases.

Using the API from notebooks in JupyterLab

esReven provides a JupyterLab instance, accessible via the My notebooks app, which allows you to use the Reven Python API from your browser.

No specific installation is required.

For more information on this method of using the API, please refer to the dedicated documentation page.

Using the API on the Reven server container

The Python API is already installed on the Reven server container. The procedure below explains how to use it.

IMPORTANT: To issue docker commands on the esReven server to the Reven container, your system user will need either be sudoer or belong to the docker group.

  1. On the esReven server, find the ID of the Reven container:
    • docker ps
  2. Open a shell on the docker:
    • docker exec -it <eshard/reven2... container id> /bin/bash
  3. Switch to the reven user:
    • su - reven
  4. Go to the /reven directory:
    • cd /reven
  5. Then issue the following command line:
    • source sourceme_python3
    • IMPORTANT: The sourceme_python3 file is a bash script and may not work as intended when sourced from different shells (fish, zsh...).
    • This results in activating a virtualenv with the Python API installed. To deactivate it and get back to your original Python environment, either open a new shell, or run the deactivate command in the current shell where the virtualenv was activated.
  6. You can start scripting with the Python API.
    • IMPORTANT: In the Reven server container, make sure to save your work on a directory tree exported outside the container, such as /Reven2, so that your work is not lost when the container is stopped.

Using the API from a client workstation

To install the API on a client workstation, you will need to download the corresponding archive from the Download page of the Project Manager.
Choose the package corresponding to the desired OS and Python version.

This section assumes that you are working from the root directory of the decompressed archive.

Pre-requisites

The supported platforms for installing the Reven Python API are Debian 10 Buster 64-bit and Windows 10 64-bit. A working 3.7 (CPython) installation is also required.

NOTE-1: For Debian, other dependencies will be installed over the course of this document and can be found in the dependencies.sh file.

Main installation options

Python development provides many ways of installing a Python package. This document covers the main installation options.

Windows

First, be sure to have a 64-bit 3.7 installation available with the pip utility installed. The default Python installer typically provides this component.

NOTE: the Reven python API is not compatible with a 32-bit python environment.

Debian 10 Buster

For a Debian 10 Buster client, the recommended way to use the Python API is to simply source the sourceme file contained in the downloaded archive:

This will leave in a virtual environment where reven2 can be imported:

python -c "import reven2"

Note that the sourceme file is a bash script and may not work as intended when sourced from different shells (fish, zsh...).

Debian 10 Buster, manual installation

If you prefer installing in your own virtualenv, or as user or system-wide, follow the instructions below.

First, be sure to have a Python installation available with the corresponding pip utility installed.

Next steps

If you successfully completed the previous steps, you should have a working Reven Python API. Feel free to check out the Getting Started module in the Knowledge Base for a smooth kick-off.