Skip to main content

The banana package is a python client to interact with your Potassium servers hosted on Banana

Project description

Banana Python SDK

Getting Started

Install via pip

pip3 install banana-dev

If integration testing against a local Potassium server:

export BANANA_SERVER=local

to call http://localhost:8000/ directly. Be sure to unset in prod!

If deploying to prod: Sign in / log in here to get your API and Model Keys

Run:

import banana_dev as banana

# Your credentials. Can be empty strings if testing against a local server.
api_key = "demo" # YOUR_API_KEY
model_key = "carrot" # YOUR_MODEL_KEY

model_inputs = {
    # a json specific to your model. For example:
    "imageURL":  "https://demo-images-banana.s3.us-west-1.amazonaws.com/image2.jpg"
}

out = banana.run(api_key, model_key, model_inputs)
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 caption of the image
            "caption": "a baseball player throwing a ball"
        }
    ]
}

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_staging-5.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

banana_dev_staging-5.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file banana_dev_staging-5.0.1.tar.gz.

File metadata

  • Download URL: banana_dev_staging-5.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for banana_dev_staging-5.0.1.tar.gz
Algorithm Hash digest
SHA256 affe064fdf64e38d3eb70307baf95cbce271deab3fdde2742b47c13bdec129fe
MD5 b925742dc4fa54cf1b1a67959eff24d8
BLAKE2b-256 a6422b9b1948f6fb350bb0ef87cf561ba03146627312aee8e7a174b78dac4ffa

See more details on using hashes here.

File details

Details for the file banana_dev_staging-5.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for banana_dev_staging-5.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67336576d46060e40f2bcdf7e0df2e8faa58db6fff969e9154f31c793edd66ad
MD5 a59da5b7aa8d6aae9f67afef63cfdce4
BLAKE2b-256 d836c2ee7052966e1262524dc98edaf2c38540bc9b58209af343398a2b0743bd

See more details on using hashes here.

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