Skip to main content
End of Swift Science Operations, CHIME Notices Unavailable During Upgrade. 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