Skip to main content

No project description provided

Project description

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))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamz_nats-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file streamz_nats-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: streamz_nats-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.1 Darwin/23.0.0

File hashes

Hashes for streamz_nats-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8c4177624411d5cff465545e1e049f736c03e98bf72fe3e6e2d37cfdbb2bad
MD5 ccd79fc517ed40eed3e2f73c5aa8dc5e
BLAKE2b-256 b4d1cb7628fcfe573675e39a61ee50f0c6d3816a8c1d9c45f2c3688c3303f9d1

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