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)
| 1055 | |
| 1056 | |
| 1057 | def 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 | ) |
nothing calls this directly
no test coverage detected
searching dependent graphs…