MCPcopy Create free account
hub / github.com/ipython/ipython / format_display_data

Function format_display_data

IPython/core/formatters.py:991–1024  ·  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

989
990
991def format_display_data(obj, include=None, exclude=None):
992 """Return a format data dict for an object.
993
994 By default all format types will be computed.
995
996 Parameters
997 ----------
998 obj : object
999 The Python object whose format data will be computed.
1000
1001 Returns
1002 -------
1003 format_dict : dict
1004 A dictionary of key/value pairs, one or each format that was
1005 generated for the object. The keys are the format types, which
1006 will usually be MIME type strings and the values and JSON'able
1007 data structure containing the raw data for the representation in
1008 that format.
1009 include : list or tuple, optional
1010 A list of format type strings (MIME types) to include in the
1011 format data dict. If this is set *only* the format types included
1012 in this list will be computed.
1013 exclude : list or tuple, optional
1014 A list of format type string (MIME types) to exclude in the format
1015 data dict. If this is set all format types will be computed,
1016 except for those included in this argument.
1017 """
1018 from .interactiveshell import InteractiveShell
1019
1020 return InteractiveShell.instance().display_formatter.format(
1021 obj,
1022 include,
1023 exclude
1024 )

Callers

nothing calls this directly

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected