Skip to main content

Python client for the Serf orchestration tool

Project description

trio-serf is an async Python interface to Serf, the decentralised solution for service discovery and orchestration.

It uses trio <> as its underlying async framework. Previous versions used the anyio <> wrapper, thus worked with asyncio, trio, and curio, but this has been discontinued because of issues with error handling.

PyPI latest version badge Code coverage badge


trio-serf requires a running Serf agent. See Serf’s agent documentation for instructions.

To install trio-serf, run the following command:

$ pip install trio-serf

or alternatively (you really should be using pip though):

$ easy_install trio-serf

or from source:

$ python install

Getting Started

These examples require a running async loop. Trio <> is recommended, though asyncio works too.

from trio_serf import serf_client

async with serf_client() as client:
    await client.event('foo', 'bar')

Stream usage:

from trio_serf import serf_client

async with serf_client() as client:
    async with'*') as stream:
        async for resp in stream:


You can run the tests using the following commands:

$ serf agent --tag foo=bar & # start serf agent
$ python3 -mpytest tests

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

trio_serf-0.4.0.tar.gz (30.4 kB view hashes)

Uploaded Source

Supported by

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