Skip to main content

aiobananas is an async version of banana-dev

Project description

Banana Python SDK

Getting Started

Install via pip pip3 install aiobananas

Get your API Key

Run:

import aiobananas

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"
}

async with aiobananas.Session(api_key) as banana:
    out = await banana.run(model_key, model_inputs)



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

aiobananas-4.0.1.post2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiobananas-4.0.1.post2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file aiobananas-4.0.1.post2.tar.gz.

File metadata

  • Download URL: aiobananas-4.0.1.post2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.79.1-microsoft-standard-WSL2

File hashes

Hashes for aiobananas-4.0.1.post2.tar.gz
Algorithm Hash digest
SHA256 4d57a8c9817d8f1f0562d7c52eee668c165f7f7505b8df81fd33f27c8229de43
MD5 f9bb4c8c1b9b4ee24cec7fe13961a87f
BLAKE2b-256 6773092f0457e1dfcec1d0e0853f6a6b4187dd56f7b1fbcf76ad2fccd325ceaf

See more details on using hashes here.

File details

Details for the file aiobananas-4.0.1.post2-py3-none-any.whl.

File metadata

  • Download URL: aiobananas-4.0.1.post2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.79.1-microsoft-standard-WSL2

File hashes

Hashes for aiobananas-4.0.1.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 a220fe98ee0573f614ccdc9eecf862d1b06e7ceced8347fc3815a9689d43964e
MD5 e87029f0d3bdd38dfbb3bd3573cbdb2a
BLAKE2b-256 fc3a3f72e2ac4411a6383994a186649c3aaf517902c2415c13d3c68151111b58

See more details on using hashes here.

Supported by

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