Skip to main content

Lightweight SDK for pushing automation run logs to the Manage AI dashboard

Project description

Manage AI SDK

Lightweight Python SDK for pushing automation run logs to the Manage AI dashboard.

Install

pip install manage-ai-sdk
# or directly from the repo
pip install "manage-ai-sdk @ git+https://github.com/Shfa-AI/manage-ai.git#subdirectory=sdk"

Setup

Set two environment variables (or pass them explicitly):

export MANAGE_AI_URL=https://your-dashboard.example.com
export MANAGE_AI_KEY=ak_your_api_key_here

Get these from the Connection section on any automation's detail page in the dashboard.

Usage

Decorator (simplest)

from manage_ai_sdk import automation

@automation("b1000000-0000-0000-0000-000000000001")
def daily_invoice_email():
    invoices = fetch_invoices()
    send_emails(invoices)
    return {"invoices_sent": len(invoices)}

if __name__ == "__main__":
    daily_invoice_email()

The decorator automatically:

  • Reports the run as started when the function begins
  • Reports success with the return value as output when it finishes
  • Reports failure with the traceback if an exception occurs
  • Tracks duration

Context manager (for embedding in existing code)

from manage_ai_sdk import track_run

with track_run("b1000000-0000-0000-0000-000000000001") as run:
    result = do_stuff()
    run.output = {"data": result}

Explicit client (for advanced usage)

from manage_ai_sdk import ManageAI

client = ManageAI(url="https://...", api_key="ak_...")
run_id = client.start_run("b1000000-...", trigger={"type": "cron"})

try:
    result = do_stuff()
    client.complete_run("b1000000-...", run_id, output={"data": result}, duration_ms=1234)
except Exception as e:
    client.fail_run("b1000000-...", run_id, error=str(e))
    raise

Configuration priority

  1. Explicit argumentsautomation("id", url="...", api_key="...")
  2. Environment variablesMANAGE_AI_URL, MANAGE_AI_KEY

Failure behavior

If the dashboard is unreachable, the SDK logs a warning but does not crash your automation. Your code always runs regardless of whether the dashboard is available.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manage_ai_sdk-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manage_ai_sdk-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file manage_ai_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: manage_ai_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for manage_ai_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2ba82f87f1c3192b365f286956eb7a86e8edbb7d09bf037a48898e6e1536414
MD5 785def504e0f8a7c2adaadc10cce7e98
BLAKE2b-256 79f49d0d06056554a17e8b96f6af8678a8597f17163c9cc6ee3f3ae65bba0a7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for manage_ai_sdk-0.1.0.tar.gz:

Publisher: publish-sdk.yml on Shfa-AI/manage-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file manage_ai_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: manage_ai_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for manage_ai_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 698892bf16981ea144c45815812426d4d17d87ddf903f5b40b57dc44f15f596e
MD5 308adf24dcb6e74c046d47f0de2fab31
BLAKE2b-256 2bac9be03ff489d91928cb6c566a138fc9e1d46e0549dd8fa282401d62d3cec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for manage_ai_sdk-0.1.0-py3-none-any.whl:

Publisher: publish-sdk.yml on Shfa-AI/manage-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page