A Jupyter message is a collection of five components: a header, a parent_header, metadata, content, and buffers. While the exact wire serialization is defined by the wire protocol, a logical representation is a dictionary of dictionaries.
- header: Contains metadata about the message (ID, session, type, version, etc.).
- parent_header: A copy of the
header from the message that triggered this one (e.g., a reply's parent_header is a copy of the request's header). Used by clients to route outputs to the correct UI elements (like a specific cell). - metadata: An optional dictionary for extra information (e.g., from extensions).
- content: The actual body of the message, whose structure depends on the
msg_type. - buffers: A list of additional binary buffers (used by extensions like
ipywidgets or IPython Parallel).
{
"header" : {
"msg_id": "...",
"msg_type": "...",
...
},
"parent_header": {},
"metadata": {},
"content": {},
"buffers": [],
}