Methods

Objects

Python

SDK Installation Guide

How to install the CALLR Python SDK

Summary

    Requirements


    The installation and usage of the python-sdk requires the following:

    With PyPi



    1. To install the CALLR python library with PyPi (pip) simple run the following command:
    2.     $ pip install callr
          Collecting callr
              Downloading callr-x.x.x.tar.gz
          Building wheels for collected packages: callr
              Running setup.py bdist_wheel for callr ... done
              Stored in directory: .cache/pip/wheels/3d/18/04/753a63fd03a9778686f316fba71a83bce09567efdd457b6dff
          Successfully built callr
          Installing collected packages: callr
          Successfully installed callr-x.x.x
      
      

    3. You must also install the future package, which is a dependency of the CALLR python library.
    4. 
          $ pip install future
          Collecting future
              Downloading future-x.xx.x.tar.gz (1.6MB)
          Building wheels for collected packages: future
              Running setup.py bdist_wheel for future ... done
              Stored in directory: .cache/pip/wheels/11/c5/d2/ad287de27d0f0d646f119dcffb921f4e63df128f28ab0a1bda
          Successfully built future
          Installing collected packages: future
          Successfully installed future-x.xx.x
      
      

    5. To use the newly installed package import it into your source code.
    6.     import callr, os, sys
      
          api = callr.Api("login","password")
          result = api.call("system.get_timestamp")
          print(result)
          ...
      
      

    With requirements.txt



    1. As an alternative to installing 1 by 1 with pip, create a file called requirements.txt with the following content:
    2. 
          callr>=2
          future>=0.15.2
      
      

    3. Then run the folling pip command:
    4. 
          $ pip install -r requirements.txt
          Collecting callr>=x (from -r requirements.txt (line 1))
              Downloading callr-x.x.x.tar.gz
          Collecting future>=x.xx.x (from -r requirements.txt (line 2))
              Downloading future-x.xx.x.tar.gz (1.6MB)
          Building wheels for collected packages: callr, future
              Running setup.py bdist_wheel for callr ... done
              Stored in directory: .cache/pip/wheels/3d/18/04/753a63fd03a9778686f316fba71a83bce09567efdd457b6dff
              Running setup.py bdist_wheel for future ... done
              Stored in directory: .cache/pip/wheels/11/c5/d2/ad287de27d0f0d646f119dcffb921f4e63df128f28ab0a1bda
          Successfully built callr future
          Installing collected packages: callr, future
          Successfully installed callr-x.x.x future-x.xx.x
      
      

    5. To use the newly installed package import it into your source code.
    6.     import callr, os, sys
      
          api = callr.Api("login","password")
          result = api.call("system.get_timestamp")
          print(result)
          ...
      
      

    Without PyPi


    If you do not wish to use a package manager, perform the following steps:


    1. Download the callr SDK from our github or from pypi and extract the contents.

    2. In your project source you need to append the sdk path to the Python path using sys.path.append:
    3.     import sys
          sys.path.append("/path/to/callr_folder")
          import callr
      
          api = callr.Api("login", "password")
          ...
      

    Further help