Skip to main content

NATS JetStream connectivity for Bluesky

Project description

bluesky-nats

This module allows to:

  • publish Bluesky documents to a NATS JetStream
  • consume a NATS JetStream

Installation

Install from pypi

uv add bluesky-nats

Install with dependecies to run the examples

uv add bluesky-nats --extra examples

Prerequisites

The module requires a NATS JetStream-enabled server. If not explicitly specified, the Publisher will automatically publish to the NATS JetStream "bluesky". Make sure that the respective JetStream is available on the server and that your "subject" pattern matches the configuration.

A simple Docker setup for local development and testing is provided in the docker directory, with a Readme for guidance.

Examples

This is the most basic example to create a NATS publisher subscribed to RE documents.

from bluesky.run_engine import RunEngine

from bluesky_nats.nats_client import NATSClientConfig
from bluesky_nats.nats_publisher import CoroutineExecutor, NATSPublisher

if __name__ == "__main__":
    RE = RunEngine({})
    config = NATSClientConfig()

    nats_publisher = NATSPublisher(
        client_config=config,
        executor=CoroutineExecutor(RE.loop),
        subject_factory="events.nats-bluesky",
    )

    RE.subscribe(nats_publisher)

Follow the instructions for more information about the examples.

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

bluesky_nats-0.1.3rc1.tar.gz (111.8 kB view details)

Uploaded Source

Built Distribution

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

bluesky_nats-0.1.3rc1-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file bluesky_nats-0.1.3rc1.tar.gz.

File metadata

  • Download URL: bluesky_nats-0.1.3rc1.tar.gz
  • Upload date:
  • Size: 111.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for bluesky_nats-0.1.3rc1.tar.gz
Algorithm Hash digest
SHA256 0f3c4d6ea3ab900375d755197a8e11d72013970a2ee3e561c9959c6485012af1
MD5 4169bca5bac7a389eb900ce294eef598
BLAKE2b-256 0e2e1a775b1b67238f767119cbba78e0b3d9d835ebe5aa37811b92de2f8bd67d

See more details on using hashes here.

File details

Details for the file bluesky_nats-0.1.3rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for bluesky_nats-0.1.3rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 239cc00b60206942adf3894da26bd8111e434377fe1d72fe9ba89add672c77ec
MD5 69283279780a6ba7179966247b8aaaff
BLAKE2b-256 05f6a9106281e1f8e0efbaa448b66c04a54eb2dbe7a3c48b995833d2b1d13506

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