Cross-notebook communication via MQTT. For a practical example see bmedicke/quantum_cryptography.
Receiving a message from a subscribed topci:
Breaking a caesar ciphre by using a frequency analysis to calculate the key.
This notebooks calculates the greatest common divisor and colors numbers to make it easier to keep track of the steps.
An image showing the current status in a Pomodoro cycle is displayed (via Markdown output). The data is read from an csv file and automatically updates when it changes.
This notebook analysis a csv file created by a script running speedtest-cli to compare internet provider speeds.
A series of tutorials covering Jupyter and useful libraries.
# initial setup:
git clone https://github.com/bmedicke/amalthea.git
cd amalthea
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
# subsequent starts:
source env/bin/activate # if not active.
jupyter notebook notebooks/
# if you don't want your browser to open add the flag: --no-browser
# to access the notebook from another device add: --ip=0.0.0.0
{
"shortcuts": [
{
"command": "notebook:run-cell",
"keys": [ ";" ],
"selector": ".jp-Notebook:focus"
},
{
"command": "kernelmenu:restart-and-clear",
"keys": [ "Ctrl L" ],
"selector": ".jp-Notebook:focus"
},
{
"command": "notebook:restart-run-all",
"keys": [ "Ctrl Shift R" ],
"selector": ".jp-Notebook:focus"
}
]
}
- list of commands: https://jupyterlab.readthedocs.io/en/latest/user/commands.html
Edit the file: ~/.jupyter/nbconfig/notebook.json
.
{
"Cell": {
"cm_config": {
"lineNumbers": true
}
},
"keys": {
"command": {
"bind": {
";": "jupyter-notebook:run-cell",
"?": "jupyter-notebook:show-keyboard-shortcuts",
"ctrl-l": "jupyter-notebook:clear-cell-output",
"g,c": "jupyter-notebook:restart-kernel-and-clear-output",
"g,i": "jupyter-notebook:interrupt-kernel",
"g,r": "jupyter-notebook:restart-kernel-and-run-all-cells",
"g,s": "jupyter-notebook:shutdown-kernel",
"h": "jupyter-notebook:scroll-notebook-up",
"i": "jupyter-notebook:enter-edit-mode",
"l": "jupyter-notebook:scroll-notebook-down",
"s": "jupyter-notebook:split-cell-at-cursor",
"shift-/": "jupyter-notebook:show-keyboard-shortcuts",
"cmd-c": "jupyter-notebook:copy-cell",
"ctrl-v": "jupyter-notebook:paste-cell-replace",
"shift-j": "jupyter-notebook:extend-selection-below",
"shift-k": "jupyter-notebook:extend-selection-above",
"ctrl-j": "jupyter-notebook:move-cell-down",
"ctrl-k": "jupyter-notebook:move-cell-up"
},
"unbind": [
"l",
"h",
"i,i",
"s"
]
}
},
"Notebook": {
"Header": true,
"Toolbar": true
}
}
installing libraries from git repos that are not on PyPi
pip install -e git+https://github.com/pvigier/perlin-numpy#egg=perlin-numpy
updating the requirements.txt
file after adding or updating libs
pip freeze > requirements.txt
Most of these are in the PyPi and thus can be installed with pip
. For the rest the pip-egg command will be listed.
- ipympl
- for
%matplotlib widget
- for
- matplotlib
- paho-mqtt
- pandas
- perlin-numpy
pip install -e git+https://github.com/pvigier/perlin-numpy#egg=perlin-numpy
- scipy
- seaborn
- termcolor
- ipywidgets
Installation without using requirements.txt
:
pip install matplotlib paho-mqtt pandas scipy seaborn termcolor ipympl jupyterlab\
-e git+https://github.com/pvigier/perlin-numpy#egg=perlin-numpy