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.
Documentation
The REST API documentation is available at AI Hub docs.
Installation
# 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.
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 conventions, though certain backwards-incompatible changes may be released as minor versions:
- Changes that only affect static types, without breaking runtime behavior.
- 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).
- 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 with questions, bugs, or suggestions.
Requirements
Python 3.7 or higher.
Metadata
Release files for instabase-aihub 0.14.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| instabase_aihub-0.14.0.tar.gz | 76.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| instabase_aihub-0.14.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 260.1 kB
Release files / instabase_aihub-0.14.0.tar.gz
| Download URL | instabase_aihub-0.14.0.tar.gz |
|---|---|
| Size | 76.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96664a81282152243b55ca6561a5d49cf38564cd64ebc25c8f0e0c753ce17dbe
|
|
BLAKE2b-256 checksum How to use checksums |
2d87c6366db437863342c375b22857d3bb5e679bab2d57a1ac1550edefbfd739
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / instabase_aihub-0.14.0-py3-none-any.whl
| Download URL | instabase_aihub-0.14.0-py3-none-any.whl |
|---|---|
| Size | 183.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da3d0c8b6d03983e7e425d9893b5567f1c9db1789f0679f4ee9df87916239516
|
|
BLAKE2b-256 checksum How to use checksums |
5b0f071d8270bfe22b0bb10d84a7e4cba4b8c4360bbdd21baf663cc7b0a7b974
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for instabase-aihub 0.14.0
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.