ob-ipython will display anything back from ipython with the mime type ‘text/org’ verbatim. This allows you and others to create formatters that output raw org. For example, drop this in your ipython startup file to have arrays and dataframes rendered as org tables:
import IPython
from tabulate import tabulate
class OrgFormatter(IPython.core.formatters.BaseFormatter):
def __call__(self, obj):
try:
return tabulate(obj, headers='keys',
tablefmt='orgtbl', showindex='always')
except:
return None
ip = get_ipython()
ip.display_formatter.formatters['text/org'] = OrgFormatter()