Testing / Aug 12 2019
Reading Notebook
Test File download / viewing
Mime bundles
import json def readfile(file, mode): f = open(file, mode) bin = f.read() f.close() return bin class Bundles: def _repr_mimebundle_(self, include=None, exclude=None): png_bin = readfile(plotly.plotly.json, "rb") jpeg_bin = readfile(plotly.plotly.json, "rb") svg_str = readfile(plotly.plotly.json, "r") csv_str = readfile(plotly.plotly.json, "r") csv_str = readfile(plotly.plotly.json, "r") vega_str = readfile(plotly.plotly.json, "r") plotly_str = readfile(plotly.plotly.json, "r") return { #"application/json": {"hi": [2,3,4]}, "image/png": png_bin, "image/jpeg": jpeg_bin, "text/plain" : "so plain", #"text/latex" : '\\int_0^\\infty e^{-x^2} dx=\\frac{\\sqrt{\\pi}}{2}', #"image/svg+xml" : svg_str, "text/csv" : csv_str, "application/vnd.vegalite.v3+json" : vega_str, "application/vnd.plotly.v1+json" : plotly_str, }, {} Bundles()