Skip to main content

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]

Metadata

Release files for banana-dev-staging 5.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for banana-dev-staging 5.0.1
File Size Uploaded Provenance
banana_dev_staging-5.0.1.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for banana-dev-staging 5.0.1
File Interpreter ABI Platform
banana_dev_staging-5.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / banana_dev_staging-5.0.1.tar.gz

Download URL banana_dev_staging-5.0.1.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
affe064fdf64e38d3eb70307baf95cbce271deab3fdde2742b47c13bdec129fe
BLAKE2b-256 checksum
How to use checksums
a6422b9b1948f6fb350bb0ef87cf561ba03146627312aee8e7a174b78dac4ffa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / banana_dev_staging-5.0.1-py3-none-any.whl

Download URL banana_dev_staging-5.0.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67336576d46060e40f2bcdf7e0df2e8faa58db6fff969e9154f31c793edd66ad
BLAKE2b-256 checksum
How to use checksums
d836c2ee7052966e1262524dc98edaf2c38540bc9b58209af343398a2b0743bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Security for banana-dev-staging 5.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

5.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page