rbvermaa / rai-sdk-python

The RelationalAI Software Development Kit (SDK) for Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The RelationalAI Software Development Kit for Python

Workflow Status
Continuous Integration (CI) build
Publish to PYPI publish

The RelationalAI (RAI) SDK for Python enables developers to access the RAI REST APIs from Python.

Getting started

Requirements

  • Python 3.7+

Installing the SDK

Install using pip:

$ [sudo] pip install rai-sdk

Install from source using pip:

$ git clone git@github.com:RelationalAI/rai-sdk-python.git
$ cd rai-sdk-python
$ [sudo] python3 setup.py install

Install from source in editable mode.

$ git clone git@github.com:RelationalAI/rai-sdk-python.git
$ cd rai-sdk-python
$ [sudo] pip install -r requirements.txt
$ [sudo] pip install -e .

Create a configuration file

In order to run the examples and, you will need to create an SDK config file. The default location for the file is $HOME/.rai/config and the file should include the following:

Using OAuth Client Credentials

Sample configuration using OAuth client credentials:

[default]
host = azure.relationalai.com
port = <api-port>      # optional, default: 443
scheme = <scheme>      # optional, default: https
client_id = <your client_id>
client_secret = <your client secret>
client_credentials_url = <account login URL>  # optional
# default: https://login.relationalai.com/oauth/token

Client credentials can be created using the RAI console at https://console.relationalai.com/login

Using API Access Key Credentials

Sample configuration using API access key credentials (deprecated):

[default]
host = azure.relationalai.com
port = <api-port>      # optional, default: 443
scheme = <scheme>      # optional, default: https
access_key = <your public access key>
private_key_filname = <name of file containing private key>

Note, the SDK expects to find the private key file in the same folder as the config file.

You can copy config.spec from the root of this repo and modify as needed.

Generate python protobuf sources from protobuf specification

python -m grpc_tools.protoc -I railib/pb --python_out=./railib/pb railib/pb/*.proto

Examples

Each of the example files in the ./examples folder is standalone and can be run from the command line, eg:

$ cd examples
$ python3 ./list_engines.py

Support

You can reach the RAI developer support team at support@relational.ai

Contributing

We value feedback and contributions from our developer community. Feel free to submit an issue or a PR here.

License

The RelationalAI Software Development Kit for Python is licensed under the Apache License 2.0. See: https://github.com/RelationalAI/rai-sdk-python/blob/master/LICENSE

About

The RelationalAI Software Development Kit (SDK) for Python.

License:Apache License 2.0


Languages

Language:Python 97.5%Language:Ruby 1.2%Language:Shell 1.2%Language:PureBasic 0.1%