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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for gcn_kafka-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa294501ff76ac57c85176797d6f8c0f1ef27914f07837a72314952ee11cae8f |
|
MD5 | a9b38654b344d5397091fbdd66a421d2 |
|
BLAKE2b-256 | d4f6659aa5fc1cba605a18b04742e2e26a15d18318fb14f87fd0e535babddf10 |