Skip to main content

Nats plugin for Streamz

This a plugin for Streamz that adds stream nodes for writing and reading data from/to NATS.

🛠 Installation

Latest stable version is available on PyPI

pip install streamz_nats

Latest development version can be installed from git repo

pip install git+https://github.com/MarekWadinger/streamz_nats

⚡️ Quickstart

To start working with streamz_nats, follow these 3 steps:

1. Run a standalone NATS cluster locally

docker run -t -d -p 4222:4222 --name streamz-nats nats:latest

2. Create a consumer

The following example creates a consumer of the greet.* topics, where * is wildcard for any substring, receives incoming messages, prints the content and ID of messages that arrive, and acknowledges each message to the Pulsar broker.

import nats
from streamz import Stream

s = Stream.from_nats(
    'nats://localhost:4222',
    ['greet.*'],
    )

s.map(lambda x: x.decode())
L = s.sink_to_list()

s.start()
while True:
    try:
        if L:
            print(L.pop(-1))

Release files for streamz-nats 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for streamz-nats 0.1.0
File Interpreter ABI Platform
streamz_nats-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / streamz_nats-0.1.0-py3-none-any.whl

Download URL streamz_nats-0.1.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c8c4177624411d5cff465545e1e049f736c03e98bf72fe3e6e2d37cfdbb2bad
BLAKE2b-256 checksum
How to use checksums
b4d1cb7628fcfe573675e39a61ee50f0c6d3816a8c1d9c45f2c3688c3303f9d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.1 Darwin/23.0.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page