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.1.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file gcn-kafka-0.1.1.tar.gz
.
File metadata
- Download URL: gcn-kafka-0.1.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eb6d8fb812796720709521e53b11b30ed49f808d0a1d2c1197a896eefffd580 |
|
MD5 | 197448c9ea9b602bbb9be8ebfb9b2689 |
|
BLAKE2b-256 | e08a6b4312b9fab7b988048cdb8d32fe3047e3038086821d4a8c64b4c09b6ef0 |
File details
Details for the file gcn_kafka-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: gcn_kafka-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ad0465a458905659de9eece2449a260de24e44bf73d6c2d2f88b113d0f871e |
|
MD5 | 1538d4dcd63a96b145c1711280717106 |
|
BLAKE2b-256 | 1e2cfef21ab9f4e08a6d6ad6d7421a960b4dcb05116e39f11eae3bc85d55d817 |