Skip to main content

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

Project description

marona

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

Marona provides a simple interface for messaging, discovering apps, managing permissions, connecting service accounts, receiving inbound events, and using tools from any compatible runtime.

You can use it with Marona Cloud or with your own self-hosted Marona-compatible runtime.

marona has two separate surfaces:

  • client.hub.connect(...): free Hub integration for developers using their own agents.
  • client.runtime.message(...): paid Marona Runtime usage that consumes Marona Credits.

Install

pip install marona

Send a message

import asyncio

from marona import Marona


async def main() -> None:
    client = Marona(
        base_url="https://edge.marona.ai",
        api_key="mrn_live_...",
    )
    response = await client.message(
        "Create a PowerPoint about AI introduction",
        interface="api",
        conversation_id="demo",
    )
    print(response.reply)
    for artifact in response.artifacts:
        print(artifact.get("filename"))


asyncio.run(main())

Connect Hub Apps

Use Hub integration 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(
        ["gmail", "calendar"],
        adapter="openai_mcp",
    )
    print(servers)


asyncio.run(main())

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

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

Hub integration does not call Marona Runtime and does not consume Marona Credits.

Runtime targets

Marona Cloud:

from marona import Marona

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

Self-hosted:

from marona import Marona

client = Marona(
    base_url="https://my-company-edge.example.com",
    api_key="mrn_live_...",
)

List available apps

import asyncio

from marona import Marona


async def main() -> None:
    client = Marona("https://edge.marona.ai")
    apps = await client.list_apps(limit=20, search="slides")

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


asyncio.run(main())

Pair an interface with WhatsApp

import asyncio

from marona import Marona


async def main() -> None:
    client = Marona("https://edge.marona.ai")
    pairing = await client.start_pairing(interface="web", device_name="My web app")

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


asyncio.run(main())

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

status = await client.pairing_status(pairing.pairing_id)

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

Use the identity token on future requests:

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

Connect an app account

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

import asyncio

from marona import Marona


async def main() -> None:
    client = Marona("https://edge.marona.ai")
    identity_token = "mrn_identity_token_from_pairing"
    connection = await client.connect_app(
        "slides",
        provider="google",
        identity_token=identity_token,
        return_url="https://example.com/connected",
    )

    print(connection.authorization_url)


asyncio.run(main())

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

Attach files

import asyncio

from marona import Marona, RuntimeAttachment


async def main() -> None:
    identity_token = "mrn_identity_token_from_pairing"
    attachment = RuntimeAttachment.from_bytes(
        b"hello",
        filename="note.txt",
        mime_type="text/plain",
        kind="document",
    )

    client = Marona("https://edge.marona.ai")
    response = await client.message(
        "Summarize this file",
        attachments=[attachment],
        identity_token=identity_token,
    )
    print(response.reply)


asyncio.run(main())

Advanced

EdgeRuntimeClient is kept as a compatibility class for existing integrations. New integrations should import Marona.

Release

Build and verify the package before uploading:

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

Upload with the project-scoped PyPI token for marona:

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

Use a project-scoped token for normal releases. Account-wide tokens should only be used for the first upload of a new PyPI project.

Project details


Release history Release notifications | RSS feed

This version

0.1.2

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.2.tar.gz (14.6 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.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: marona-0.1.2.tar.gz
  • Upload date:
  • Size: 14.6 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.2.tar.gz
Algorithm Hash digest
SHA256 022c81c1ac81e5d9591a0e36145f2ab5fe46714764fd68652508484cf62ec8b0
MD5 69912e52656d0cde873c64e07ce54424
BLAKE2b-256 baa732b755501d9f7d3c2062e8a6f188f11dc986d8e05565520315cd58fc78c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: marona-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 869f703b3dc043fdb554ed1aa4009fd6dcffddd981a4905b81035775f01064c3
MD5 b1a91914cdc40fa21e9dc55f6fc83b04
BLAKE2b-256 c2459b70700bd6c2b5542c56bbd4d2af5060d6fa0fb5a52e79a39b4c7d1f387d

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