Skip to main content

The banana package is a python client to interact with your machine learning models hosted on Banana

Project description

Banana Python SDK

Getting Started

Install via pip pip3 install banana-dev

Get your API Key

Run:

import banana_dev as banana

api_key = "YOUR_API_KEY"
model_key = "YOUR_MODEL_KEY"
model_parameters = {
    # a json specific to your model. For example:
    "a": 1,
    "b": 2
}

out = banana.run(api_key, model_key, model_parameters)
print(out)

Return type:

{
    {
        "id": "12345678-1234-1234-1234-123456789012", 
        "message": "success", 
        "created": 1649712752, 
        "apiVersion": "26 Nov 2021", 
        "modelOutputs": [
            {
                # a json specific to your model. In this example, the sum of "a" and "b" from the above model_parameters
                "sum": 3, 
            }
        ]
    }
}

Parse the server output:

model_out = out["modelOutputs"][0]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

banana_dev-3.0.0.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

banana_dev-3.0.0-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page