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.3.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.3-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bluesky_nats-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3b3cb8cf8bfc17c16b6cb570974f706d555d30c62c74511dec9bbfc3b9b67ce9
MD5 50d490a4ac7b58597c708d811bfa6a38
BLAKE2b-256 4ae4ee92548d66de0416613938242cc9cc2b2c8a2ed3cf857ecdde9e5872b9cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bluesky_nats-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for bluesky_nats-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 11f8707af337680032fc3e0c81c362998f0141758adf2391d14e701b5dbf5138
MD5 8f6a1389b46ebdad932b0f447539228a
BLAKE2b-256 b2a2f6bebb8f5801ab7e8d77320236218588a31e50f40f67fc8f04d6bf7106c0

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