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)](https://gcn.nasa.gov). It is a very lightweight wrapper around [confluent-kafka-python](https://docs.confluent.io/platform/current/clients/confluent-kafka-python/html/index.html).
## To Install
Run this command to install with [pip](https://pip.pypa.io/):
` pip install gcn-kafka `
## To use
Create a consumer:
`pycon >>> from gcn_kafka import Consumer >>> consumer = Consumer(client_id='fill me in', client_secret='fill me in') `
List all topics:
`pycon >>> 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:
`pycon >>> 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
Built Distribution
File details
Details for the file gcn-kafka-0.1.0.tar.gz
.
File metadata
- Download URL: gcn-kafka-0.1.0.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 | 9942d9cb03a0de1e6791958acdab92374eeaafadc32d2a6bb30e6bf74b8aa158 |
|
MD5 | d965426cd0daa69b17d4ee98deb44591 |
|
BLAKE2b-256 | ded53fc02db915a1d24b0d2ffe0ee438c15d84daa7d7b5bc9c42c1a58828611a |
File details
Details for the file gcn_kafka-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: gcn_kafka-0.1.0-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 | 8af4b0ec0cdf931c4fe5dc617e5317f8dd42e6ea362c3f7861b84a09d4983963 |
|
MD5 | bb93dc22fa79c1286c80bd9493490bea |
|
BLAKE2b-256 | f2a7de15d90444eac1e675be96fe33f59ffae2173d1fb6c1221708083db394b9 |