Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

Python Introduction

Opal Python client, a command line scripting tool written in Python, enables automation of tasks in a Opal server.

Requirements

Python 3.x must be installed on the system. See more about Python.

Installation

You can install Opal Python Client via the following two methods:

  • use the Debian/RPM package manager
  • use a Python package

Debian Package Installation

Follow the OBiBa Debian Repository instructions and run:

sudo apt-get install opal-python-client

RPM Package Installation

Follow the OBiBa RPM Repository instructions and run:

sudo yum install opal-python-client

Python Package Installation

This type of package is cross-platform (Linux, Windows, Mac).

Install on Linux or Mac

  1. Download the most recent version
  2. Decompress the file and enter the installation folder:
tar xvzf opal-python-client-X.XX.tar.gz
cd opal-python-client-X.XX
  1. Install the package:
sudo python3 setup.py install --record installed_files.lst

Note

The --record will generate a list of installed files on your system. Since there is no uninstaller, you can use this file to remove the Opal Python Client package. You can do this by executing the following command: sudo cat installed_files.lst | xargs rm -rf

Install on Windows

  • Using Cygwin

You can install Cygwin, making sure that CURL, Python, gcc are included and follow these steps inside a Cygwin BASH window:

cd /usr/lib
cp libcurl.dll.a libcurl.a
cd <your-desired-dir>
curl -C - -O https://github.com/obiba/opal/releases/download/X.XX/opal-python-client-X.XX.tar.gz
tar xzvf opal-python-client-X.XX.tar.gz
cd opal-python-client-X.XX
python3 setup.py install --record installed_files.lst
  • Using plain Windows tools

This Windows installation is the most complicated one but does not required any third party tools. You are required to do a few manual installations before the package is fully usable.

  1. You must have Python installed on your Windows system. Run the installer for python3 downloaded from python.org.
  2. Go to the Python Libs site and download the file pycurl python package
  3. Run the pip installer on this package
  4. Download the most recent version and follow these steps:
unzip opal-python-client-X.XX.tar.gz
cd opal-python-client-X.XX
python3 setup.py bdist_wininst
cd dist
  1. Execute the generated installer and follow the instructions (opal-python-client-X.XX.win-amd64.exe)

Usage

To get the options of the command line:

opal --help

This command will display which sub-commands are available. Further, given a subcommand obtained from command above, its help message can be displayed via:

opal <subcommand> --help

This command will display available subcommands.