##// END OF EJS Templates
Backport PR #10496: Define `_repr_mimebundle_`...
Backport PR #10496: Define `_repr_mimebundle_` Allows objects to display arbitrary mime-types by returning a mimebundle. This is getting increasingly important as custom mime-types are growing in popularity. - mime-bundle is computed first, but other formatters are still called - if a mime-type is present in repr-mimebundle, `_repr_<mime>_` will not be called (avoids redundant calls for backward-compatible objects) closes 10090 cc rgbkrk Alternative design: rather than single method returning the mimebundle itself, return mime-keyed mapping to callables, e.g.: ```python def _repr_mime_methods_(self): return { 'text/html': self._repr_html_, } ``` Another more minor alternative: rather than allowing return of `data` or `(data, metadata)`, require returning the full mime-bundle with `data`, `metadata` keys: ```python def _repr_mimebundle(self): return { 'data': { 'application/vnd.foo+json': [1,2,3], }, } ```
Matthias Bussonnier -
r23619:abbf312f
Show More
Name Size Modified Last Commit Author
IPython
docs
examples
scripts
setupext
tools
.gitattributes Loading ...
.gitignore Loading ...
.mailmap Loading ...
.travis.yml Loading ...
CONTRIBUTING.md Loading ...
COPYING.rst Loading ...
Dockerfile Loading ...
MANIFEST.in Loading ...
README.rst Loading ...
codecov.yml Loading ...
setup.py Loading ...
setupbase.py Loading ...
setupegg.py Loading ...
tox.ini Loading ...
https://codecov.io/github/ipython/ipython/coverage.svg?branch=master https://img.shields.io/pypi/dm/IPython.svg https://img.shields.io/pypi/v/IPython.svg https://img.shields.io/travis/ipython/ipython.svg

IPython: Productive Interactive Computing

Overview

Welcome to IPython. Our full documentation is available on ipython.readthedocs.io and contain information on how to install, use contribute to the project.

Officially, IPython requires Python version 2.7, or 3.3 and above. IPython 1.x is the last IPython version to support Python 2.6 and 3.2.

The Notebook, Qt console and a number of other pieces are now parts of Jupyter. See the Jupyter installation docs if you want to use these.

Developement and Instant runnimg

You can find the latest version of the development documentation on readthedocs.

You can run IPython from this directory without even installing it system-wide by typing at the terminal:

$ python -m IPython

Or see the developement installation docs for the latest revision on read the docs.

Documentation and installation instructions for older version of IPython can be found on the IPython website