AppWrapper
A Python library that wraps Superb AI app functions. Used as a decorator, it automatically handles the full lifecycle of app tasks: downloading input files, executing the function, validating results, uploading outputs, and reporting status.
Installation
pip install AppWrapper
Quick Start
Normal Mode (Production)
Communicates with the TOAD backend service. Required environment variables are automatically injected.
from app_wrapper import AppWrapper
@AppWrapper()
def my_app():
# Your app logic here
return {"type": "link", "url": "https://example.com/result"}
Local Mode
Test locally using direct AWS credentials without TOAD communication.
from app_wrapper import AppWrapper
@AppWrapper(
LOCAL_MODE=True,
AWS_ACCESS_KEY_ID="your-access-key",
AWS_SECRET_ACCESS_KEY="your-secret-key",
AWS_DEFAULT_REGION="ap-northeast-2",
)
def my_app():
return {"type": "link", "url": "https://example.com/result"}
Result Format
App functions must return one of the following two types.
Link Type
Returns an external URL as the result.
{"type": "link", "url": "https://example.com/result"}
Download Type
Uploads a local file to S3 and delivers it as the result.
{"type": "download", "file_path": "/path/to/output/file.json"}
S3 File Download
Download additional S3 files within your app function.
from app_wrapper import AppWrapper
AppWrapper.download_from_s3(
bucket="my-bucket",
key="path/to/file.csv",
download_path="/tmp/file.csv",
)
Environment Variables
Environment variables required in normal mode. These are automatically injected in production.
| Variable | Description |
|---|---|
TOAD_HOST |
TOAD backend service host URL |
TENANT_ID |
Tenant ID |
TASK_ID |
Task ID |
MAIN_APP_ID |
Main app ID |
POD_FILE_PATH |
Input file download path |
APP_INPUT_FILES |
List of input file S3 paths (Python list format string) |
In local mode, pass AWS credentials directly to the AppWrapper constructor.
| Parameter | Description | Default |
|---|---|---|
AWS_ACCESS_KEY_ID |
AWS Access Key | "" |
AWS_SECRET_ACCESS_KEY |
AWS Secret Key | "" |
AWS_DEFAULT_REGION |
AWS Region | ap-northeast-2 |
Architecture
app_wrapper/
├── __init__.py # Public exports
├── app_wrapper.py # AppWrapper - decorator & orchestrator
├── s3_client.py # S3Client - S3 download/upload operations
├── status_manager.py # StatusManager - task status & log reporting
├── result_schema.py # Pydantic models for result validation
└── task_status.py # Status enum (Complete, Processing, Failed, ...)
Dependencies
requests>=2.0.0boto3>=1.13.4pydantic>=2.0.0
Metadata
Release files for AppWrapper 0.3.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 | |
|---|---|---|---|---|
| appwrapper-0.3.0.tar.gz | 5.9 kB | Without provenance | Details |
Release files / appwrapper-0.3.0.tar.gz
| Download URL | appwrapper-0.3.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba1e14209852c62f6b5dab8926fd5fa32d425dcd0ca3b25f12479fc31693f1f4
|
|
BLAKE2b-256 checksum How to use checksums |
986f9e4505a787b668a4605a407989a8bec7f96aa06ae335d896f664a9de2a63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for AppWrapper 0.3.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.