Python Introduction

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

Requirements

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

Installation

You can install Mica 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 mica-python-client

RPM Package Installation

Follow the OBiBa RPM Repository instructions and run:

sudo yum install mica-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 mica-python-client-X.XX.tar.gz
cd mica-python-client-X.XX
  1. Install the package:
sudo python 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 Mica 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/mica-python-client/releases/download/XXX/mica-python-client-XXX.tar.gz
tar xzvf mica-python-client-X.XX.tar.gz
cd mica-python-client-X.XX
python setup.py install --record installed_files.lst

Usage

To get the options of the command line:

mica --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:

mica <subcommand> --help

This command will display available subcommands.