Skip to main content
Testing. You are viewing the public testing version of GCN. For the production version, go to https://gcn.nasa.gov.
New! Browse Circulars by Event, Advanced Search, Sample Codes, Schema Release. See news and announcements

Plain Text

GCN Classic Notices are also distributed as plain text. To extract header information, one can use Python's built-in email library.

import email

def parse_text_alert_to_dict(message_value):
    return dict(email.message_from_bytes(message_value))

This function extracts the headers and returns them as key-value pairs in a Python dictionary.

Looking for U.S. government information and services? Visit USA.gov