Python SDK

Overview

The generated Neurelo Python SDK provides easy access to your Neurelo APIs for Python applications.

Refer to this Python SDK Tutorial -- News Application for a detailed tutorial on downloading, installing, and using the Python SDKs

Installation

Download the Custom Python SDK for your Project from the APIs page under the Neurelo environment that you want to interact with, place the resulting .tgz into your repository and run pip install <path/to/sdk-tgz-file>

The downloaded SDK file will be named - neurelo-sdk-python-cmt_xxxxxx.tgz (where xxxxxx are the last 6 digits of the definition commit applied to the environment)

Usage

API Usage

Basic usage requires instantiating both a Configuration and an ApiClient class:

from neurelo.configuration import Configuration
from neurelo.api_client import ApiClient

configuration = Configuration(
	host=NEURELO_API_HOST,
	api_key={'ApiKey': NEURELO_API_KEY}
)

api_client = ApiClient(configuration=configuration)

Each object defined in your Neurelo data definition has a class that can be instantiated by passing the ApiClient instance into the constructor of the object's class. For example, if your data definition contains a 'User' object, you can instantiate the User class by passing the ApiClient instance into its constructor as shown below:

from neurelo.api.user_api import UserApi

user_api = UserApi(api_client)

When calling operations with parameters, the parameters are encapsulated within specific classes. To use these parameters, create an instance of the respective class and use it as the parameter value, as shown below:

from neurelo import models

payload = models.UserCreateInput(
  email=email,
  fullname=fullname,
  password=password,
)

user = user_api.create_one_user(payload)

Type hints are available for all parameters, for all operations to aid in understanding which class is should be used with each parameter.

Example Applications

The following applications are provided to demonstrate how to use Neurelo, and Neurelo’s generated Python SDK.

Last updated