MCPcopy Index your code
hub / github.com/ipython/ipython / publish

Method publish

IPython/core/displaypub.py:82–170  ·  view source on GitHub ↗

Publish data and metadata to all frontends. 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

(
        self,
        data,
        metadata=None,
        source=_sentinel,
        *,
        transient=None,
        update=False,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

80
81 # use * to indicate transient, update are keyword-only
82 def publish(
83 self,
84 data,
85 metadata=None,
86 source=_sentinel,
87 *,
88 transient=None,
89 update=False,
90 **kwargs,
91 ) -> None:
92 """Publish data and metadata to all frontends.
93
94 See the ``display_data`` message in the messaging documentation for
95 more details about this message type.
96
97 The following MIME types are currently implemented:
98
99 * text/plain
100 * text/html
101 * text/markdown
102 * text/latex
103 * application/json
104 * application/javascript
105 * image/png
106 * image/jpeg
107 * image/svg+xml
108
109 Parameters
110 ----------
111 data : dict
112 A dictionary having keys that are valid MIME types (like
113 'text/plain' or 'image/svg+xml') and values that are the data for
114 that MIME type. The data itself must be a JSON'able data
115 structure. Minimally all data should have the 'text/plain' data,
116 which can be displayed by all frontends. If more than the plain
117 text is given, it is up to the frontend to decide which
118 representation to use.
119 metadata : dict
120 A dictionary for metadata related to the data. This can contain
121 arbitrary key, value pairs that frontends can use to interpret
122 the data. Metadata specific to each mime-type can be specified
123 in the metadata dict with the same mime-type keys as
124 the data itself.
125 source : str, deprecated
126 Unused.
127 transient : dict, keyword-only
128 A dictionary for transient data.
129 Data in this dictionary should not be persisted as part of saving this output.
130 Examples include 'display_id'.
131 update : bool, keyword-only, default: False
132 If True, only update existing outputs with the same display_id,
133 rather than creating a new output.
134 """
135
136 if source is not _sentinel:
137 import warnings
138
139 warnings.warn(

Callers 1

publish_display_dataFunction · 0.45

Calls 3

HistoryOutputClass · 0.85
warnMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected