Skip to main content

Official Python client SDK for Marona-compatible AI runtimes and Hub integrations.

Project description

marona

Official Python client for Marona-compatible AI runtimes and Marona Hub.

Use marona when you are building an application, bot, device, or agent interface that needs to:

  • send messages to a Marona-compatible runtime
  • discover available apps
  • connect approved Hub apps to your own agent framework
  • manage user permissions and service connections
  • receive inbound events
  • create realtime voice or vision sessions

Install

pip install marona

1. Create A Client

Marona Cloud:

from marona import Marona

marona = Marona(
    base_url="https://edge.marona.ai",
    api_key="mrn_live_...",
)

Self-hosted runtime:

from marona import Marona

marona = Marona(
    base_url="https://runtime.example.com",
    api_key="mrn_live_...",
)

2. Send A Runtime Message

import asyncio

from marona import Marona


async def main() -> None:
    marona = Marona(api_key="mrn_live_...")
    response = await marona.message(
        "Create a PowerPoint about AI introduction",
        interface="api",
        conversation_id="demo",
    )

    print(response.reply)
    for artifact in response.artifacts:
        print(artifact.get("filename"), artifact.get("url"))


asyncio.run(main())

3. Connect Hub Apps To Your Own Agent

Every Hub app has a unique app ID, also called a slug. Examples:

  • weather-mcp
  • knowledge-mcp
  • company-crm-mcp

Use hub.connect(...) when your own agent framework will execute the model and you only need approved app connections from Marona Hub.

import asyncio

from marona import Marona


async def main() -> None:
    marona = Marona(api_key="mrn_live_...")
    servers = await marona.hub.connect(
        ["weather-mcp", "knowledge-mcp"],
        adapter="openai_mcp",
    )
    print(servers)


asyncio.run(main())

For frameworks that need tool descriptors instead of MCP server configs:

tools = await marona.hub.connect(
    ["weather-mcp"],
    adapter="tools",
)

4. List Available Apps

apps = await marona.list_apps(limit=20, search="slides")

for app in apps.apps:
    print(app["slug"], app["name"])

5. Pair A User Interface

Pairing lets a web, mobile, desktop, wearable, or other interface attach to the same user identity.

pairing = await marona.start_pairing(
    interface="web",
    device_name="My web app",
)

print(pairing.display_code)
print(pairing.whatsapp_url)

After the user sends the pairing code from WhatsApp, poll for completion:

status = await marona.pairing_status(pairing.pairing_id)

if status.identity:
    identity_token = status.identity.access_token

Use the identity token on future requests:

response = await marona.message(
    "What is on my calendar today?",
    identity_token=identity_token,
)

6. Connect A User Service Account

Some apps need a user connection, such as Google Calendar, Gmail, or Google Slides.

connection = await marona.connect_app(
    "slides",
    provider="google",
    identity_token=identity_token,
    return_url="https://example.com/connected",
)

print(connection.authorization_url)

Open authorization_url in a browser so the user can authorize the provider.

7. Send Files

from marona import RuntimeAttachment

attachment = RuntimeAttachment.from_bytes(
    b"hello",
    filename="note.txt",
    mime_type="text/plain",
    kind="document",
)

response = await marona.message(
    "Summarize this file",
    attachments=[attachment],
    identity_token=identity_token,
)

8. Edge Runtime Activation

Device runtimes can activate and sync against Marona Hub with the same package:

from marona import EdgeHubClient

edge = EdgeHubClient(hub_url="https://hub.marona.ai")
activation = await edge.start_activation(
    device_name="Office runtime",
    device_public_key="...",
)

Package Names

  • Python client: marona, import marona
  • Dart client: marona, import package:marona/marona.dart
  • TypeScript client: marona, import Marona from "marona"
  • Developer SDK for building apps: marona-sdk, import marona_sdk

Release

Build and verify:

rm -rf dist build marona.egg-info
python3 -m build
python3 -m twine check dist/*

Upload with the project-scoped PyPI token:

TWINE_USERNAME=__token__ TWINE_PASSWORD='PROJECT_SCOPED_TOKEN' python3 -m twine upload dist/*

Project details


Release history Release notifications | RSS feed

This version

0.1.4

Download files

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

Source Distribution

marona-0.1.4.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

marona-0.1.4-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file marona-0.1.4.tar.gz.

File metadata

  • Download URL: marona-0.1.4.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for marona-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5313d812a93b012086434972d7810c8c942825ed3c3ca2ad035ef6e8d922f5bc
MD5 514ba58f6311888f302ea8d2b9e09e19
BLAKE2b-256 a3af03fe60104825854ebd2160cb5381f8e55fe57520f0443a50dc65acbbb64f

See more details on using hashes here.

File details

Details for the file marona-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: marona-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for marona-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d161215e6b2bc5579b723a1f5815dfc6b3e99b8d277d74f814c611901a4f4a72
MD5 0dc9b4959b286c6d9b4ffa19c66f7562
BLAKE2b-256 d8e54bfdc5f1c3bd1cac2538c6fecd1a9835274d940c6c84bfc8a7049cde65ef

See more details on using hashes here.

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