# Banana Python SDK
### Getting Started
Install via pip
```bash
pip3 install banana-dev
```
If integration testing against a local Potassium server:
```bash
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](https://app.banana.dev) to get your API and Model Keys
### Run:
```python
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:
```python
{
"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:
```python
model_out = out["modelOutputs"][0]
```
Raw data
{
"_id": null,
"home_page": "https://www.banana.dev",
"name": "banana-dev-staging",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Banana client,API wrapper,Banana,SDK",
"author": "Erik Dunteman",
"author_email": "erik@banana.dev",
"download_url": "https://files.pythonhosted.org/packages/a6/42/2b9b1948f6fb350bb0ef87cf561ba03146627312aee8e7a174b78dac4ffa/banana_dev_staging-5.0.1.tar.gz",
"platform": null,
"description": "# Banana Python SDK\n\n### Getting Started\n\nInstall via pip\n```bash\npip3 install banana-dev\n```\n\nIf integration testing against a local Potassium server:\n```bash\nexport BANANA_SERVER=local\n```\nto call `http://localhost:8000/` directly. Be sure to unset in prod!\n\n\nIf deploying to prod:\n[Sign in / log in here](https://app.banana.dev) to get your API and Model Keys\n\n### Run:\n\n```python\nimport banana_dev as banana\n\n# Your credentials. Can be empty strings if testing against a local server.\napi_key = \"demo\" # YOUR_API_KEY\nmodel_key = \"carrot\" # YOUR_MODEL_KEY\n\nmodel_inputs = {\n # a json specific to your model. For example:\n \"imageURL\": \"https://demo-images-banana.s3.us-west-1.amazonaws.com/image2.jpg\"\n}\n\nout = banana.run(api_key, model_key, model_inputs)\nprint(out)\n```\n\nReturn type:\n```python\n{\n \"id\": \"12345678-1234-1234-1234-123456789012\", \n \"message\": \"success\", \n \"created\": 1649712752, \n \"apiVersion\": \"26 Nov 2021\", \n \"modelOutputs\": [\n {\n # a json specific to your model. In this example, the caption of the image\n \"caption\": \"a baseball player throwing a ball\"\n }\n ]\n}\n```\n\nParse the server output:\n```python\nmodel_out = out[\"modelOutputs\"][0]\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The banana package is a python client to interact with your Potassium servers hosted on Banana",
"version": "5.0.1",
"project_urls": {
"Homepage": "https://www.banana.dev"
},
"split_keywords": [
"banana client",
"api wrapper",
"banana",
"sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d836c2ee7052966e1262524dc98edaf2c38540bc9b58209af343398a2b0743bd",
"md5": "a59da5b7aa8d6aae9f67afef63cfdce4",
"sha256": "67336576d46060e40f2bcdf7e0df2e8faa58db6fff969e9154f31c793edd66ad"
},
"downloads": -1,
"filename": "banana_dev_staging-5.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a59da5b7aa8d6aae9f67afef63cfdce4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5713,
"upload_time": "2023-06-22T03:28:53",
"upload_time_iso_8601": "2023-06-22T03:28:53.814719Z",
"url": "https://files.pythonhosted.org/packages/d8/36/c2ee7052966e1262524dc98edaf2c38540bc9b58209af343398a2b0743bd/banana_dev_staging-5.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a6422b9b1948f6fb350bb0ef87cf561ba03146627312aee8e7a174b78dac4ffa",
"md5": "b925742dc4fa54cf1b1a67959eff24d8",
"sha256": "affe064fdf64e38d3eb70307baf95cbce271deab3fdde2742b47c13bdec129fe"
},
"downloads": -1,
"filename": "banana_dev_staging-5.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b925742dc4fa54cf1b1a67959eff24d8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3548,
"upload_time": "2023-06-22T03:28:55",
"upload_time_iso_8601": "2023-06-22T03:28:55.715554Z",
"url": "https://files.pythonhosted.org/packages/a6/42/2b9b1948f6fb350bb0ef87cf561ba03146627312aee8e7a174b78dac4ffa/banana_dev_staging-5.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-22 03:28:55",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "banana-dev-staging"
}