This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / core / displaypub / DisplayPublisher / publish

function

IPython.core.displaypub:DisplayPublisher.publish

source: /IPython/core/displaypub.py :82

Signature

def   publish ( self data metadata = None source = <object object at 0x0000> * transient = None update = False ** kwargs )  →  None

Summary

Publish data and metadata to all frontends.

Extended Summary

See the display_data message in the messaging documentation for more details about this message type.

The following MIME types are currently implemented:

  • text/plain

  • text/html

  • text/markdown

  • text/latex

  • application/json

  • application/javascript

  • image/png

  • image/jpeg

  • image/svg+xml

Parameters

data : dict

A dictionary having keys that are valid MIME types (like 'text/plain' or 'image/svg+xml') and values that are the data for that MIME type. The data itself must be a JSON'able data structure. Minimally all data should have the 'text/plain' data, which can be displayed by all frontends. If more than the plain text is given, it is up to the frontend to decide which representation to use.

metadata : dict

A dictionary for metadata related to the data. This can contain arbitrary key, value pairs that frontends can use to interpret the data. Metadata specific to each mime-type can be specified in the metadata dict with the same mime-type keys as the data itself.

source : str, deprecated

Unused.

transient : dict, keyword-only

A dictionary for transient data. Data in this dictionary should not be persisted as part of saving this output. Examples include 'display_id'.

update : bool, keyword-only, default: False

If True, only update existing outputs with the same display_id, rather than creating a new output.

Aliases

  • IPython.core.displaypub.DisplayPublisher.publish