Skip to main content

Thin Python wrapper for the Skyffla machine API

Project description

Skyffla Python Wrapper

This package is a thin async wrapper over skyffla host|join <room> machine --json.

Install

cd wrappers/python
uv sync

The wrapper expects a skyffla binary in PATH. Override it with SKYFFLA_BIN or the binary= argument when starting a room.

Versioning is split across two layers:

  • machine protocol compatibility follows docs/versioning.md and docs/machine-protocol.md: the wrapper requires the same machine protocol major version and tolerates additive minor changes
  • release pairing is stricter for published packages: by default, the wrapper also checks that the spawned skyffla binary has the exact same release version as the Python package

Set SKYFFLA_SKIP_VERSION_CHECK=1 only when you intentionally want to bypass the release-version pairing check. It does not bypass the machine protocol compatibility check.

Async Example

import asyncio

from skyffla import Room


async def main() -> None:
    async with await Room.join("warehouse", name="python-agent") as room:
        await room.wait_for_welcome()
        await room.send_chat("all", "hello from python")
        print(await room.wait_for_chat())


asyncio.run(main())

Sync Example

from skyffla import SyncRoom


with SyncRoom.join("warehouse", name="python-agent") as room:
    room.wait_for_welcome()
    room.send_chat("all", "hello from sync python")
    print(room.wait_for_chat())

For a minimal runnable script, see examples/simple_chat.py.

Same machine or LAN:

uv run python examples/simple_chat.py host demo-room --local
uv run python examples/simple_chat.py join demo-room --local

Or let both sides use join and allow the first process to promote itself to host:

uv run python examples/simple_chat.py join demo-room --local
uv run python examples/simple_chat.py join demo-room --local

examples/simple_chat.py is now a minimal interactive chat client. Start one host and one join process, then type lines in either terminal. Use /quit to exit.

For --local, start the host first and give local discovery a few seconds to advertise before starting the join side. If the join side promotes itself to host, use --server with a local skyffla-rendezvous for deterministic same-machine testing.

Custom rendezvous server:

uv run python examples/simple_chat.py host demo-room --server http://127.0.0.1:8080
uv run python examples/simple_chat.py join demo-room --server http://127.0.0.1:8080

Tests

cd wrappers/python
uv run pytest

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

skyffla-1.1.1.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

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

skyffla-1.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file skyffla-1.1.1.tar.gz.

File metadata

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

File hashes

Hashes for skyffla-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d8aaad5b8d132ae077801fb44f08a98ed607a24727c5641222dfd52cb3958706
MD5 51d8813949a760347db8659460aa76fc
BLAKE2b-256 176353241204ce7f245e4fee712c3f5e4fe307cb618b07b33f8a79bac47b9ff4

See more details on using hashes here.

Provenance

The following attestation bundles were made for skyffla-1.1.1.tar.gz:

Publisher: python-package.yml on skyffla/skyffla

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

File details

Details for the file skyffla-1.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for skyffla-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c94294b06c029208209787a3e9f80dd28f5fca0533c745a5df325715ed636464
MD5 d696bc74155bfef2b8656ff67fcaee64
BLAKE2b-256 2fb39e62ee1b7a0347b0c9d4f73c2e1cf21dd010164a4affff03927cae9e4dff

See more details on using hashes here.

Provenance

The following attestation bundles were made for skyffla-1.1.1-py3-none-any.whl:

Publisher: python-package.yml on skyffla/skyffla

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