-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Problem
Currently, a YFile represents a plain text document. This seems to assume that a document with no particular structure should be of text type, while it could also be binary.
Even a YNotebook seems to assume that a notebook will always have the JSON type that we know, but it might not be the case anymore in the future (Jupyter notebooks could evolve towards a Markdown-based format).
These two Y documents were derived from jupyter-server, where we have a file model and a notebook model. The file model can be of type text or binary, but in the latter case it is base64-encoded. The notebook model has a JSON type.
Proposed Solution
I think we should not stick to what jupyter-server is doing, and have:
YText: a plain text document.YBytes: a binary document.YJsonNotebook: a JSON-encoded notebook.YMdNotebook: a Markdown-encoded notebook.
Or include the type/version in the Y document instantiation. For instance, keep YFile and YNotebook but instantiate with:
YFile("text")/YFile("bytes")YNotebook(version="5.7.1")
Thoughts?