Skip to main content

Kafka client for NASA's General Coordinates Network (GCN)

Project description

GCN Kafka Client for Python

This is the official Python client for the General Coordinates Network (GCN). It is a very lightweight wrapper around confluent-kafka-python.

To Install

Run this command to install with pip:

pip install gcn-kafka

To use

Create a consumer:

>>> from gcn_kafka import Consumer
>>> consumer = Consumer(client_id='fill me in', client_secret='fill me in')

List all topics:

>>> print(consumer.list_topics().topics)
{'gcn.classic.text.CALET_GBM_FLT_LC': TopicMetadata(gcn.classic.text.CALET_GBM_FLT_LC, 1 partitions), 'gcn.classic.voevent.FERMI_GBM_SUBTHRESH': TopicMetadata(gcn.classic.voevent.FERMI_GBM_SUBTHRESH, 1 partitions), ...}

Subscribe to topics and receive alerts:

>>> consumer.subscribe(['gcn.classic.text.FERMI_GBM_FIN_POS', 'gcn.classic.text.LVC_INITIAL'])
>>> while True:
...     for message in consumer.consume():
...         print(message.value())

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

gcn-kafka-0.1.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

gcn_kafka-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file gcn-kafka-0.1.2.tar.gz.

File metadata

  • Download URL: gcn-kafka-0.1.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for gcn-kafka-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cc9c709a7ce518e4696bcffe9377181b29c11954bcd1d7abf1a496fbea0ceee9
MD5 54217899efdcc0ad0ea581ca6bcf7563
BLAKE2b-256 b992ae471de84f74bacc94c0c129359a03b5da43bb7f64fcf062e20c4eccb7ed

See more details on using hashes here.

File details

Details for the file gcn_kafka-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gcn_kafka-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for gcn_kafka-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 aa294501ff76ac57c85176797d6f8c0f1ef27914f07837a72314952ee11cae8f
MD5 a9b38654b344d5397091fbdd66a421d2
BLAKE2b-256 d4f6659aa5fc1cba605a18b04742e2e26a15d18318fb14f87fd0e535babddf10

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page