Getting Started

Interact programatically with nannyML cloud throughout its SDK

NannyML Cloud SDK is a Python package that enables programmatic interaction with NannyML Cloud. It allows you to automate all aspects of NannyML Cloud, including:

  • Creating a model for monitoring.

  • Logging inferences for analysis.

  • Triggering model analysis

If you prefer a video walkthrough, here's our YouTube guide:

Installation

The nannyml-cloud-sdk package is available on PyPi and can be installed using your favorite package manager.

Compatibility

The following table shows which versions of the SDK are compatible with which versions of the NannyML Cloud product.

SDK Version
NannyML Cloud Version

>=0.1.6

>=0.24.1

Authentication

To use the NannyML Cloud SDK, you need to provide the URL of your NannyML Cloud instance and an API token to authenticate. You can obtain an API token on the account settings page of your NannyML Cloud instance.

After clicking the create button you'll be presented with a prompt to enter an optional description for the API token. We recommend describing what you intend to use the token for so you know which token to revoke later when you no longer need it. Copy the token from the prompt and store it in a secure location.

Once you have an API token you can use it to authenticate the NannyML Cloud SDK. Either by inserting the token & URL directly into the python code:

import nannyml_cloud_sdk as nml_sdk

nml_sdk.url = "https://beta.app.nannyml.com"
nml_sdk.api_token = r"api token goes here"

Or using environment variables:

import nannyml_cloud_sdk as nml_sdk
import os

nml_sdk.url = os.environ['NML_SDK_URL']
nml_sdk.api_token = os.environ['NML_SDK_API_TOKEN']

We recommend using an environment variable for the API token. This prevents accidentally leaking any token associated with your personal account when sharing code.

Last updated