Skip to content

gufolabs/gufo_liftbridge

Repository files navigation

Gufo Liftbridge

An asynchronous Python Liftbridge client

PyPi version Python Versions License Build Sponsors


Documentation: https://docs.gufolabs.com/gufo_liftbridge/

Source Code: https://github.com/gufolabs/gufo_liftbridge/


Gufo Liftbridge is the Python asyncio Liftbridge client library. It hides complex cluster topology management handling tasks and the internals of the gRPC as well. Client offers following features:

  • Publishing.
  • Subscribing.
  • Bulk publishing.
  • Cursors manipulation.
  • Cluster metadata fetching.
  • Stream creating and destroying.
  • Transparent data compression (own extension, may be not compatible with other clients).

Installing

pip install gufo_liftbridge

Publishing

from gufo.liftbridge.client import LiftbridgeClient

async def publish():
    async with LiftbridgeClient(["127.0.0.1:9292"]) as client:
        await client.publish(b"mybinarydata", stream="test", partition=0)

Subscribing

from gufo.liftbridge.client import LiftbridgeClient

async def subscribe():
    async with LiftbridgeClient(["127.0.0.1:9292"]) as client:
        async for msg in client.subscribe("test", partition=0):
            print(f"{msg.offset}: {msg.value}")

Virtues

  • Clean async API.
  • High-performance.
  • Full Python typing support.
  • Editor completion.
  • Well-tested, battle-proven code.

On Gufo Stack

This product is a part of Gufo Stack - the collaborative effort led by Gufo Labs. Our goal is to create a robust and flexible set of tools to create network management software and automate routine administration tasks.

To do this, we extract the key technologies that have proven themselves in the NOC and bring them as separate packages. Then we work on API, performance tuning, documentation, and testing. The NOC uses the final result as the external dependencies.

Gufo Stack makes the NOC better, and this is our primary task. But other products can benefit from Gufo Stack too. So we believe that our effort will make the other network management products better.