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

Uploaded Python 3

File details

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

File metadata

  • Download URL: skyffla-1.1.2.tar.gz
  • Upload date:
  • Size: 33.2 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.2.tar.gz
Algorithm Hash digest
SHA256 01b43e56b4086055a30198ea19046acb3982edff4c6802af6e44d68216b15067
MD5 4a6af0b8a469fa87834c8c5e1ec596da
BLAKE2b-256 cfecd2f8185627df78f1460ad727e327ed10e89541165044b397dd043d06e93a

See more details on using hashes here.

Provenance

The following attestation bundles were made for skyffla-1.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: skyffla-1.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 38b09fef64060aec97191cfa23eaa45fc15244713066e9cfb3ec0cd03a66d6d9
MD5 4daa54d5b21b0760107dd8124d316fd8
BLAKE2b-256 2cb96d24e7619f46ecfcc804f1446ad506f23dc0cf505bd1724a6ad315a3f92f

See more details on using hashes here.

Provenance

The following attestation bundles were made for skyffla-1.1.2-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