GithubHelp home page GithubHelp logo

mtatton / euporie Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joouha/euporie

0.0 0.0 0.0 1.8 MB

Euporie is a text-based user interface for running and editing Jupyter notebooks

License: MIT License

Python 100.00%

euporie's Introduction

euporie

screenshot 1

About

Euporie is a text-based user interface for running and editing Jupyter notebooks.

Install

Euporie is on pypi, so can be installed using pip or pipx:

# install inside a virtualenv
pip install euporie

# install globally
pipx install euporie

You may wish to install some optional python dependencies to render images and HTML tables (but see below):

pip install euporie[html-mtable,images-timg]

Screenshots

screenshot 2 screenshot 3 screenshot 4 screenshot 5 screenshot 6

Features

  • Execute notebooks in the terminal
  • Autocompletion in code cells
  • Rich output support, including:
    • Markdown
    • Tables
    • Images
  • Open multiple notebooks side-by-side
  • Good performance with large notebook files

Image Support

Euporie will attempt to render images in the best possible way it can. The following methods are supported:

The kitty & sixel image rendering methods will fall back to ansi art images when rendering images in partially obscured cells, to prevent clipped images destroying the user interface.

For SVG support, cairosvg or imagemagik are required.

HTML Support

Euporie will attempt to render HTML outputs. This requires one of the following:

w3m elinks lynx links mtable

Note: only HTML tables will be displayed if mtable is used

If none of these commands are found in your $PATH, the plain text representation will be used.

Usage

usage: euporie [-h] [--verion] [--dump | --no-dump] [--dump-file [Path]]
               [--page | --no-page] [--key-map {emacs,vi}]
               [--run-after-external-edit bool] [--max-notebook-width int]
               [--background-pattern {0,1,2,3,4}] [--background-character str]
               [--line-numbers | --no-line-numbers] [--syntax-theme str]
               [Path ...]

positional arguments:
  Path                  List of file names to open

optional arguments:
  -h, --help            show this help message and exit
  --verion, -V          show program's version number and exit
  --dump, --no-dump     Output formatted file to display or file
  --dump-file [Path]    Output path when dumping file
  --page, --no-page     Pass output to pager
  --key-map {emacs,vi}  Key-binding mode for text editing
  --run-after-external-edit bool
                        Run cells after editing externally
  --max-notebook-width int
                        Maximum width of notebooks
  --background-pattern {0,1,2,3,4}
                        The background pattern to use
  --background-character str
                        Character for background pattern
  --line-numbers, --no-line-numbers
                        Show or hide line numbers
  --syntax-theme str    Syntax higlighting theme

Key Bindings

Key Binding Command
Application
Ctrl+n Create a new notebook file
Ctrl+o Open file
Ctrl+w Close the current file
Ctrl+q Quit euporie
Navigation
Tab Focus next element
Shift+Tab Focus previous element
[ Scroll up
] Scroll down
Ctrl+Up / Home Go to first cell
Pageup Go up 5 cells
Up / k Go up one cell
Down / j Go down one cell
Pagedown Go down 5 cells
Ctrl+Down / End Go to last cell
Notebook
a Add new cell above current
b Add new cell below current
d d Delete current cell
x Cut current cell
c Copy current cell
v Paste copied cell
m Change cell to markdown
y Change cell to code
r Change cell to raw
l Toggle line numbers
I I Interrupt notebook kernel
0 0 Restart notebook kernel
e Edit cell in $EDITOR
Enter Enter cell edit mode
Escape Exit cell edit mode *
Escape Escape Exit cell edit mode quickly
Ctrl+Enter / Ctrl+e Run cell*
Shift+Enter / Ctrl+r Run then select next cell**
Edit Mode
Ctrl+f Find
Ctrl+g Find Next
Ctrl+z Undo
Ctrl+d Duplicate line
Tab Indent
Shift+Tab Unindent
Ctrl+c Copy
Ctrl+x Cut
Ctrl+v Paste

* There is a slight delay detecting an escape key-event. To exit edit mode quickly, double-press the escape key.

** Shift+Enter and Ctrl+Enter require your terminal to support CSI-u mode. If your terminal does not support this, it may be possible to work around this by remapping the keys in your terminal emulator - see below).

When in edit mode, emacs style key-bindings apply by default.

Key Remapping

By default, VT100 terminal emulators do not distinguish between Enter, Ctrl+Enter & Shift+Enter. In order to work around this, it is possible to re-map these key bindings so they produce the escape code of another key. To replicate the Ctrl + Enter & Shift + Enter of Jupyter, you will need to remap the following shortcuts in your terminal:

Key Combination Output
Ctrl+Enter Ctrl+F20
Shift+Enter F21

xterm

Add the following to your ~/.Xresources

*.vt100.translations: #override \n\
    Ctrl <Key>Return: string("\033\[19;6~") \n\
    Shift <Key>Return: string("\033\[20;2~") \n\

konsole

In the menu, navigate to:

Settings -> Edit Current Profile -> Keyboard -> Edit

Change the existing entry for Return+Shift to Return+Shift+Ctrl (or whatever you prefer), then add the following entries:

Key combination Output
Return+Ctrl \E\[19;6~
Return+Shift \E\[20;2~

Roadmap

  • Add ability to dump formatted notebooks
  • Add command line argument parsing
  • Render outputs asynchronously in a separate thread
  • Upstream markdown tables in rich
  • Cell attachments
  • LaTeX
  • Widgets

Related projects

euporie's People

Contributors

joouha avatar 0xflotus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.