# Instabase AI Hub Python Library
The AI Hub Python library provides convenient access to the AI Hub REST API from any Python 3.7+ application. The library includes type definitions for all request params and response fields.
The SDK is automatically from an OpenAPI specification using the [OpenAPI Generator](https://openapi-generator.tech).
## Documentation
The REST API documentation is available at [AI Hub docs](https://docs.instabase.com).
## Installation
```sh
# install from PyPI
pip install instabase-aihub
```
### Usage
Here is a simple example that creates a batch by uploading a single file and runs an app to summarize it.
```py
from aihub import AIHub
import os
import time
# Initializes the client. Set the API token.
client = AIHub(api_key="<API-TOKEN>")
# Creates a batch and adds files.
batch = client.batches.create(name='<BATCH-NAME>')
file_paths = ['<inner/folder/sample1.pdf>', '<.../sample2.docx>', '<.../sample3.png>']
for file_path in file_paths:
with open(file_path, "rb") as file:
client.batches.add_file(id=batch.id, file_name=os.path.basename(file_path), file=file)
# Runs an app and gets the results when the app run is complete.
run = client.apps.runs.create(app_name='<APP-NAME>', owner=None, batch_id=batch.id)
# Continuously checks the run status until it's done.
while True:
status = client.apps.runs.status(run.id)
if status.status == 'COMPLETE':
break
time.sleep(5) # Polling interval
results = client.apps.runs.results(run.id)
```
## Versioning
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
1. Changes that only affect static types, without breaking runtime behavior.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
3. Changes that we do not expect to impact the vast majority of users in practice.
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
We are keen for your feedback; please open an [issue](https://www.github.com/instabase/aihub-sdk/issues) with questions, bugs, or suggestions.
## Requirements
Python 3.7 or higher.
Raw data
{
"_id": null,
"home_page": "https://docs.instabase.com",
"name": "instabase-aihub",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Instabase, AI Hub API",
"author": "Instabase Support",
"author_email": "support@instabase.com",
"download_url": "https://files.pythonhosted.org/packages/6f/ea/1a86dfa03bf5a0d90976599749cabd49bdafc98fea599fbef9e134e198ca/instabase-aihub-0.12.0.tar.gz",
"platform": null,
"description": "# Instabase AI Hub Python Library\n\nThe AI Hub Python library provides convenient access to the AI Hub REST API from any Python 3.7+ application. The library includes type definitions for all request params and response fields.\n\nThe SDK is automatically from an OpenAPI specification using the [OpenAPI Generator](https://openapi-generator.tech).\n\n## Documentation\n\nThe REST API documentation is available at [AI Hub docs](https://docs.instabase.com).\n\n## Installation\n\n```sh\n# install from PyPI\npip install instabase-aihub\n```\n\n### Usage\n\nHere is a simple example that creates a batch by uploading a single file and runs an app to summarize it.\n\n```py\nfrom aihub import AIHub\nimport os\nimport time\n\n# Initializes the client. Set the API token.\nclient = AIHub(api_key=\"<API-TOKEN>\")\n\n# Creates a batch and adds files.\nbatch = client.batches.create(name='<BATCH-NAME>')\nfile_paths = ['<inner/folder/sample1.pdf>', '<.../sample2.docx>', '<.../sample3.png>']\nfor file_path in file_paths:\n with open(file_path, \"rb\") as file:\n client.batches.add_file(id=batch.id, file_name=os.path.basename(file_path), file=file)\n\n# Runs an app and gets the results when the app run is complete.\nrun = client.apps.runs.create(app_name='<APP-NAME>', owner=None, batch_id=batch.id)\n\n# Continuously checks the run status until it's done.\nwhile True:\n status = client.apps.runs.status(run.id)\n if status.status == 'COMPLETE':\n break\n time.sleep(5) # Polling interval\n\nresults = client.apps.runs.results(run.id)\n```\n\n## Versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes that only affect static types, without breaking runtime behavior.\n2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.\n3. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/instabase/aihub-sdk/issues) with questions, bugs, or suggestions.\n\n## Requirements\n\nPython 3.7 or higher.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "AI Hub API",
"version": "0.12.0",
"project_urls": {
"Homepage": "https://docs.instabase.com"
},
"split_keywords": [
"instabase",
" ai hub api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "af8735fed9d1b8ed42139e6f759ed152da0478e83c660035fdb353c01c959ffb",
"md5": "fa0a5ab219b344c569b9fd95df06b777",
"sha256": "b21031ee453817d34e03a9e34e163655acd9abfafa7507209341f2414ecb2113"
},
"downloads": -1,
"filename": "instabase_aihub-0.12.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fa0a5ab219b344c569b9fd95df06b777",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 163371,
"upload_time": "2025-08-08T00:40:07",
"upload_time_iso_8601": "2025-08-08T00:40:07.983994Z",
"url": "https://files.pythonhosted.org/packages/af/87/35fed9d1b8ed42139e6f759ed152da0478e83c660035fdb353c01c959ffb/instabase_aihub-0.12.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6fea1a86dfa03bf5a0d90976599749cabd49bdafc98fea599fbef9e134e198ca",
"md5": "2f94ea9d0cf30712a902c7030bea4204",
"sha256": "b6e8baf43cd37d4793e4183adeb47807d0f1c737b7b96f22db730932f96d7231"
},
"downloads": -1,
"filename": "instabase-aihub-0.12.0.tar.gz",
"has_sig": false,
"md5_digest": "2f94ea9d0cf30712a902c7030bea4204",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 71892,
"upload_time": "2025-08-08T00:40:09",
"upload_time_iso_8601": "2025-08-08T00:40:09.455278Z",
"url": "https://files.pythonhosted.org/packages/6f/ea/1a86dfa03bf5a0d90976599749cabd49bdafc98fea599fbef9e134e198ca/instabase-aihub-0.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-08 00:40:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "instabase-aihub"
}