Settings

Theme

Show HN: Euporie, a Tui for Jupyter Notebooks

github.com

150 points by joouha 5 years ago · 23 comments

Reader

jdnier 5 years ago

See the source code. It's a good real-world example of how to use prompt_toolkit to create a non-trivial TUI application.

https://python-prompt-toolkit.readthedocs.io/en/master/

kbd 5 years ago

Worth noting that Jupyter themselves announced[1] 'nbterm'[2] recently, which seems like an attempt at the same thing but it seems very very immature compared to Euporie.

I don't understand why they announced nbterm at such an early stage tbh. When I tried it it was basically non-working.

[1] https://blog.jupyter.org/nbterm-jupyter-notebooks-in-the-ter...

[2] https://github.com/davidbrochart/nbterm

Edit: cool to see another project supporting kitty terminal's graphics protocol. kitty is a great terminal and has a lot of good ideas. Also, nice to see Euporie has a section on related projects that mentions nbterm.

  • dr_kiszonka 5 years ago

    nbterm, euphorie, and even Jupyter don't seem to support shortcuts for duplicating line and moving it up/down. Why is it the case? I can't be the only person using these shortcuts :-)

    (Edit: VS Code, Spyder, and PyCharm do support them, but they have their own quirks.)

    • d0mine 5 years ago

      You could try emacs + org-mode + jupyter https://github.com/nnicandro/emacs-jupyter#org-mode-source-b...

      It supports moving the current line/region up/down (e.g., using <M-up> in Python mode that is activated for editing jupyter-python cells on <C-c '>).

      • dr_kiszonka 5 years ago

        Thanks for the link. Do you know if it supports interactive Plotły plots?

        I have tried emacs a couple of times over the last 20 years (spacemacs most recently) and it always made me feel stupid. I love the idea and flexibility, and it just seems so cool, but setting up the environment and config were pretty overwhelming to me.

        • d0mine 5 years ago

          > Do you know if it supports interactive Plotły plots?

          I haven't tried it myself but perhaps it might work via widgets https://github.com/nnicandro/emacs-jupyter#building-the-widg... (my guess that might be the overwhelming part)

          If all you need is TUI for Jupyter, then a minimal .emacs conf. from the link would do:

            ; M-x package-install RET jupyter RET
            (org-babel-do-load-languages
             'org-babel-load-languages
             '((emacs-lisp . t)
               (julia . t)
               (python . t)
               (jupyter . t)))
        • Siira 5 years ago

          Static images are well supported, but I haven't heard of anything about interactive plots. Of course, it's possible in principle, but someone would need to code it.

    • joouhaOP 5 years ago

      Currently for edit mode, euporie uses the default emacs-style key-bindings from prompt_toolkit. So duplicating a line is as simple as Ctrl-a, Ctrl-k, Ctrl-y, Return, Ctrl-y !

      I think I might add a simpler shortcut.

      • dr_kiszonka 5 years ago

        Hahaha I love this comment :) I like VS Code's shortcuts, i.e.:

        - Shift + Up/Down to a move line up or down

        - Shift + Alt + Up/Down to a copy line up or down

tux3 5 years ago

Now that's an example of a good README. All the practical information you could want, and a screenshot.

(Also, clever name! I'd heard of that particular Greek deity from somewhere else, but never knew she had a moon named after her =])

snicker7 5 years ago

People who are interest in this should seriously consider Emacs's org-mode.

  • d0mine 5 years ago

    Org Babel + emacs-jupyter is a good combination https://github.com/nnicandro/emacs-jupyter#org-mode-source-b...

  • michaericalribo 5 years ago

    Yeah! Org babel makes integrating analysis in a transparent way that follows existing org mode workflows / patterns.

    There is an important feature Jupyter has that org doesn’t share: collaboration. If everyone I need to collaborate with already uses emacs and org, great—but that’s a pretty big “if,” I and haven’t seen that opportunity in the wild.

    On the other hand, jupyter notebooks may have a garbage format (JSON blobs with embedded b64? Ugh!), and the browser-driven UI sucks (IMO, as an ardent emacser), but they’re ubiquitous and the lingua franca for Python data science. Most everyone you meet is familiar with them and can incorporate them into their workflow, and there’s benefit to the direct rendering pipeline to standalone HTML in a conventional format.

    There is actually a viable jupyter interface in emacs, EIN [1]. I’ve used it a lot and it works seamlessly, and reduces the pain of using jupyter by letting me edit within emacs. There are also VS Code plugins that enable jupyter development…

    Tldr jupyter can be ugly but it’s widespread and that alone makes org mode Babel analysis a nonstarter for collaboration, but at least there are ways to run jupyter within emacs

    [1] EIN == Emacs iPython Notebook https://github.com/millejoh/emacs-ipython-notebook

samatman 5 years ago

Looks cool!

Random note: the best way to support keystrokes such as Ctrl-Enter and Shift-Enter in the terminal is CSI-u mode:

http://www.leonerd.org.uk/hacks/fixterms/

It's supported by most terminals by now.

qolop 5 years ago

Do you have support for VIM bindings? Or a plan to add them sometime in the future?

  • joouhaOP 5 years ago

    Support for vim-style bindings is already there (thanks to prompt_toolkit) - I just need to make euporie read settings from a configuration file / expose them through the menu.

    For now, you'd have to change "editing_mode" to "vi" in config.py

  • alpaca128 5 years ago

    It lets you open buffers in $EDITOR with the `e` key according to the README. So you could just open it in Vim.

spenczar5 5 years ago

It's pretty funny how we went

- from IPython (a better, notebook-style Python interpreter shell)

- to IPython notebooks (IPython, but in a browser)

- to Jupyter Notebooks (IPy notebooks, but more backends)

- to Euporie, a text interface to Jupyter notebooks

Of course this does way more than IPython ever did, or even should do. But it's a pretty funny trajectory, everything old is new again.

  • filmor 5 years ago

    IPython itself was never "notebook style", it was just a better REPL.

Dalrymple 5 years ago

TUI already has a far more established technical meaning. From www.yourdictionary.com:

TUI =

(Telephone User Interface) The combination of Touch-tone input from the telephone keypad coupled with speech output from the connected voicemail or IVR application. While early speech technology was struggling to recognize voice utterances for voice control and data entry, the ubiquitous Touch-tone keypad was a practical solution. It works with enterprise telephone networks, the PSTN, public payphones and traditional cellphones. Its centerpiece is the standard 12-key keypad and conventions such as using the pound key for "enter," the star key for "up one level" or "escape," and "1" for yes, "2" for no.

Using this abbreviation for new uses can only reduce readability.

  • kgarten 5 years ago

    Searching in Google „TUI abbreviation“ gives me a list with Touch User Interface at the top followed by Terminal user Interface , then Telephone User Interface.

    https://acronyms.thefreedictionary.com/TUI

    Yes, there is a more established term for TUI, yet it’s not what you thought it is. TUI for terminal user interface is not so new and not so obscure as you make it sound (especially in the data science, ipython, Julia, etc. Community).

    I think as it‘s an expert Interface the abbreviation is not such a big problem. Yet, I agree it‘s always good to give the full term before using an abbreviation.

  • tptacek 5 years ago

    I still remember the color order for the wires on a DS1 crossover cable and even I know that "TUI" means "text UI".

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection