Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Euporie, a Tui for Jupyter Notebooks (github.com/joouha)
150 points by joouha on May 8, 2021 | hide | past | favorite | 23 comments



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/


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.


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.)


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 '>).


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.


> 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)))


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.


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.


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


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 =])


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


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


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


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.


I hadn't come across this before - thanks!


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


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


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


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.


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


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.


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.


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




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: