Skip to main content
Testing. You are viewing the public testing version of GCN. For the production version, go to https://gcn.nasa.gov.
Due to the lapse in federal government funding, NASA is not updating this website. See the Operations FAQ for GCN impacts.
New! Super-Kamiokande JSON Notices and Schema v4.5.0. 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