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

Function format_display_data

IPython/core/formatters.py:1057–1090  ·  view source on GitHub ↗

Return a format data dict for an object. By default all format types will be computed. Parameters ---------- obj : object The Python object whose format data will be computed. Returns ------- format_dict : dict A dictionary of key/value pairs, one or ea

(obj, include=None, exclude=None)

Source from the content-addressed store, hash-verified

1055
1056
1057def format_display_data(obj, include=None, exclude=None):
1058 """Return a format data dict for an object.
1059
1060 By default all format types will be computed.
1061
1062 Parameters
1063 ----------
1064 obj : object
1065 The Python object whose format data will be computed.
1066
1067 Returns
1068 -------
1069 format_dict : dict
1070 A dictionary of key/value pairs, one or each format that was
1071 generated for the object. The keys are the format types, which
1072 will usually be MIME type strings and the values and JSON'able
1073 data structure containing the raw data for the representation in
1074 that format.
1075 include : list or tuple, optional
1076 A list of format type strings (MIME types) to include in the
1077 format data dict. If this is set *only* the format types included
1078 in this list will be computed.
1079 exclude : list or tuple, optional
1080 A list of format type string (MIME types) to exclude in the format
1081 data dict. If this is set all format types will be computed,
1082 except for those included in this argument.
1083 """
1084 from .interactiveshell import InteractiveShell
1085
1086 return InteractiveShell.instance().display_formatter.format(
1087 obj,
1088 include,
1089 exclude
1090 )

Callers

nothing calls this directly

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…