Skip to main content

Fork of nbterm. Jupyter Notebooks in Your terminal.

Project description

Code style: black

 ______  _______ _______ _______ _______ ___ ___ ___  ___ ___
|   _  \|   _   |       |   _   |   _   |   Y   |   |(   Y   )
|.  |   |.  1   |.|   | |.  1___|.  l   |.      |.  | \  1  /
|.  |   |.  _   `-|.  |-|.  __)_|.  _   |. \_/  |.  | /  _  \
|:  |   |:  1    \|:  | |:  1   |:  |   |:  |   |:  |/:  |   \
|::.|   |::.. .  /|::.| |::.. . |::.|:. |::.|:. |::.(::. |:.  )
`--- ---`-------' `---' `-------`--- ---`--- ---`---'`--- ---'

Lets you view, edit and execute Jupyter Notebooks in the terminal.

Install

Using pip:

pip install nbtermix

Using conda:

mamba install nbtermix -c conda-forge

You will also need a kernel, e.g. ipykernel or xeus-python for Python, xeus-cling for C++.

Usage

Open an interactive notebook:

$ nbtermix my_notebook.ipynb

Run a notebook in batch mode:

$ nbtermix --run my_notebook.ipynb

Key bindings

There are two modes: edit mode, and command mode.

  • e: enter the edit mode, allowing to type into the cell.
  • esc: exit the edit mode and enter the command mode.

In edit mode:

  • ctrl-e: run cell.
  • ctrl-r: run cell and select below in edit mode.
  • ctrl-t: open cell result in external editor.
  • ctrl-w: open cell in external editor.
  • ctrl-f: save tmp file from cell and execute it.
  • ctrl-s: save.

In command mode:

  • up or k: select cell above.
  • down or j: select cell below.
  • ctrl-g: go to last cell.
  • 1 g: go to first cell.
  • ctrl-up: move cell above.
  • ctrl-down: move cell below.
  • right : scroll output right
  • left : scroll output left
  • ctrl-b : reset output scroll shift
  • a: insert cell above.
  • b: insert cell below.
  • x: cut the cell.
  • c: copy the cell.
  • ctrl-v: paste cell above.
  • v: paste cell below.
  • o: set as code cell.
  • r: set as Markdown cell.
  • l: clear cell outputs.
  • ctrl-l: clear all cell outputs.
  • f: fold current cell input.
  • ctrl-f: Search
  • n: Repeat last search.
  • ctrl-n: Search backwards.
  • m,<any>: Set mark .
  • ',<any>: Go to mark .
  • ctrl-e or enter: run cell.
  • ctrl-r or alt-enter: run cell and select below.
  • ctrl-s: save.
  • ctrl-p: run all cells.
  • ctrl-q: exit.
  • ctrl-h: show help.

Kernels

For more kernels visit:

Jupyter kernels . jupyter/jupyter Wiki

This nbtermix is tested on (install only if You know what You're doing):

c kernel

pip install jupyter-c-kernel
install_c_kernel

java kernel

wget https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip
unzip ijava-1.3.0.zip -d ijava
cd ijava
python install.py
apt-get isntall default-jdk

javascript kernel

apt-get install nodejs npm libczmq-dev
npm install -g --unsafe-perm npm
npm install -g --unsafe-perm ijavascript
ijsinstall --install=global

php kernel

apt-get install php composer php-zmq
wget https://litipk.github.io/Jupyter-PHP-Installer/dist/jupyter-php-installer.phar
chmod u+x jupyter-php-installer.phar
./jupyter-php-installer.phar install

sqlite kernel from sqlok

pip3 install sqli-kernel
sqlik_install

python3 kernel

out of the box

Testing environment

using Python 3.9 and iPyKernel==6.0.0

pip install ipykernel==6.0.0

$ jupyter --version:

jupyter core     : 4.7.1
ipython          : 7.25.0
ipykernel        : 6.0.0
jupyter client   : 6.1.12

Runtime Environment recommendations

Keep separated environment for the nbtermix

|= mkdir -p ~/pyenv
cd ~/pyenv
|= virtualenv -p /usr/bin/python3.9 nbtermix
|= source ~/pyenv/nbtermix/bin/activate

CHANGELOG

minor changes to v.0.0.18 by mtatton
+ scrollable output using left and right
minor changes to v.0.0.17 by mtatton
minor changes to v.0.0.16 by mtatton
minor changes to v.0.0.15 by mtatton
+ added folding for terminal space saving
+ renamed to nbtermix
minor changes to v.0.0.14 by mtatton
minor changes to v.0.0.13 by mtatton
minor changes to v.0.0.12 by mtatton

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbtermix-0.0.18.tar.gz (16.4 kB view details)

Uploaded Source

File details

Details for the file nbtermix-0.0.18.tar.gz.

File metadata

  • Download URL: nbtermix-0.0.18.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.3

File hashes

Hashes for nbtermix-0.0.18.tar.gz
Algorithm Hash digest
SHA256 cdafee79fbdabe1b822027ebc82364bbb5a2457fca6de9a18593a439625c9c32
MD5 d5637f40fadc33b09ec1a2d0c9fc6af3
BLAKE2b-256 a5b5a76db78e0631c941ebc68ca37274057fab59dd7867af8ba56faca90673e3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page