Add repr method for arbitrary mime-types #10090

minrk opened this Issue Dec 14, 2016 · 2 comments


None yet

2 participants

minrk commented Dec 14, 2016

We have _repr_foo_ methods for a few common mime-types, but this mapping doesn't extend well to custom mime-types. I propose we add a new magic method that returns the full, formatted mime data, such as:

def _repr_mime_(self):
    """Return mimetype-bundled representation(s) of me"""
    return {
        'data': {
            'application/vnd.tableschema.v1+json': {...},
            'text/html': '<div>...',
        'metadata': {},

details: should this override or be in addition to existing methods if found?

cc @rgbkrk

@minrk minrk added this to the 6.0 milestone Dec 14, 2016
@minrk minrk referenced this issue in pandas-dev/pandas Dec 14, 2016

Support exporting to JSON Table Schema #14386

rgbkrk commented Dec 14, 2016

Thanks for raising this up! It should likely override since it's a full manifest.

minrk commented Dec 15, 2016

Oops, sorry for the dupe of #10058. Copying comment from there: The _ipython_display_ escape hatch makes this less urgent (and is perhaps why we still haven't done it), but this should still be done nonetheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment