Skip to main content

micro-framewaork on top of kappa architecture

Project description

micro-framewaork on top of kappa architecture

On the top of kappa --- is a disk, called "kappa no sara" in Japanese Yokai.

Syntax was inspired from faust and flask.

from osara import Tap

tap = Tap({"bootstrap.servers":"127.0.0.1", "group.id":"demo"})

@tap.handler("topic_x")
def handle_x(msg):
	print("Got %s" % msg)

if __name__=="__main__":
	tap.start().wait()

shema support

pydantic schema can be attached to topic.

from pydantic import BaseModel
from osara import Tap
tap = Tap({"bootstrap.servers":"127.0.0.1", "group.id":"demo"})

@tap.schema("topic_x")
class X(BaseModel):
	msg: str

@tap.handler("topic_x")
def handle_x(msg):
	# you can access parsed data via "model" method
	print("Got %s" % msg.model().msg)

if __name__=="__main__":
	tap.start().wait()

produce, then consume

Sometime, we want RPC style message flow.

from osara import Tap
tap = Tap({"bootstrap.servers":"127.0.0.1", "group.id":"demo"})
for msg in tap.map_reduce("topic_x", b"hello", topic_filter=["topic_x"]):
	print(msg)
	if msg.value == b"hello":
		break

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

osara-0.0.6.tar.gz (7.8 kB view details)

Uploaded Source

File details

Details for the file osara-0.0.6.tar.gz.

File metadata

  • Download URL: osara-0.0.6.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

File hashes

Hashes for osara-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e7439c1cfa769d1d52a0ca54771aed9fc6e39ceda687b89a1edcf65e78a3a1f9
MD5 176523635ce4ec70311d24b04e48dd34
BLAKE2b-256 e91d1aa5906519bc3f023d35eb0ed3017b60014e2d5150ec3ab5d3da3b04712e

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