PredicSis python SDK

https://circleci.com/gh/PredicSis/predicsis-python-sdk.svg?style=svg Documentation Status

Documentation

A complete documentation is available there: documentation

Installation

Install the python SDK package:

pip install predicsis

or using the git repository:

git clone https://github.com/PredicSis/predicsis-python-sdk
python setup.py install

(optional) Setup your environment variables

You can used the SDK with an explicit configuration of url instance and token or you can provide them as environment variables: PREDICSIS_URL and PREDICSIS_TOKEN.

For example on unix-like system:

$ export PREDICSIS_URL=http://your_predicsis.ai_url/api
$ export PREDICSIS_TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJ...'

Warning

PredicSis.ai URL have to end with /api.

Note

The explicit configuration overrides the implicit one.

Note

Token can be provided by the administrator using GUI (see documentation) or using the SDK (see predicsis.PredicSis._Admin.create_token():)

Test your installation

You can run tests with the following python lines:

  • Test if it is properly installed:
>>> import predicsis
>>> predicsis.__version__
'2.0.0'

The python SDK is properly connected to your PredicSis.ai:

>>> from predicsis import PredicSis
>>> # if environment variables are setup
>>> prds = PredicSis()
>>> # otherwise
>>> # prds = PredicSis(predicsis_url="...", token="...")
>>> prds.admin.versions()
[
    {
        'name': 'atlas',
        'version': '0.0.1'
    }, {
        'name': 'license_authority',
        'version': u'1.3.2'
    }, {
        'name': 'dmgr',
        'version': '0.0.1'
    }, {
        'name': 'modeler',
        'version': '0.0.1'
    }, {
        'name': 'exporter',
        'version': '0.0.1'
    }, {
        'name': 'prds_sdk',
        'version': '2.0.0'
    }
]

It is well configured! Congratulation!

Let’s begin with PredicSis.

Support

Please refer to Logger section if you have any unexpected behavior using the SDK.

Indices and tables