| name | jupyter-live-kernel |
| description | Jupyter notebook and kernel operations — start kernels, execute cells programmatically, export, and data analysis patterns. |
| version | 1.0.0 |
| author | hermes-CCC (ported from Hermes Agent by NousResearch) |
| license | MIT |
| metadata | {"hermes":{"tags":["Data-Science","Jupyter","Python","Analysis","Notebooks","Kernels"],"related_skills":["grpo-rl-training","huggingface-hub"]}} |
Jupyter Live Kernel
Run notebooks, execute cells programmatically, and manage Jupyter kernels.
Setup
pip install jupyter jupyterlab nbformat nbconvert ipykernel
python -m ipykernel install --user --name myenv --display-name "My Env"
Start Jupyter
jupyter lab --no-browser --port 8888
jupyter notebook --no-browser --port 8888
jupyter lab --ip 0.0.0.0 --no-browser
jupyter lab /path/to/project
Execute Notebooks Programmatically
jupyter nbconvert --to notebook --execute input.ipynb --output output.ipynb
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 input.ipynb
jupyter nbconvert --to html notebook.ipynb
jupyter nbconvert --to script notebook.ipynb
jupyter nbconvert --to pdf notebook.ipynb
Create Notebooks with nbformat
import nbformat
nb = nbformat.v4.new_notebook()
nb.cells.append(nbformat.v4.new_markdown_cell("# My Analysis"))
nb.cells.append(nbformat.v4.new_code_cell("""
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('data.csv')
df.head()
"""))
with open("analysis.ipynb", "w") as f:
nbformat.write(nb, f)
Execute Cells Programmatically with nbclient
import nbformat
from nbclient import NotebookClient
with open("analysis.ipynb") as f:
nb = nbformat.read(f, as_version=4)
client = NotebookClient(nb, timeout=600, kernel_name="python3")
client.execute()
with open("analysis_output.ipynb", "w") as f:
nbformat.write(nb, f)
Papermill — Parameterized Notebooks
pip install papermill
papermill input.ipynb output.ipynb -p learning_rate 0.001 -p epochs 10
papermill input.ipynb output.ipynb -y "{'config': {'lr': 0.001}}"
Mark parameter cell with tag parameters in the notebook.
Kernel Management
jupyter kernel list
jupyter kernelspec list
source myenv/bin/activate
pip install ipykernel
python -m ipykernel install --user --name myenv
jupyter kernelspec remove myenv
Magic Commands (in notebooks)
%timeit [i**2 for i in range(1000)]
%%timeit
result = [i**2 for i in range(1000)]
!pip install pandas
!ls -la
%matplotlib inline
%load script.py
%load_ext autoreload
%autoreload 2
%%bash
echo "Hello from bash"
ls
Common Data Analysis Pattern
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv("data.csv")
print(df.shape)
df.info()
df.describe()
df.isnull().sum()
fig, axes = plt.subplots(1, 2, figsize=(12, 4))
df["column"].hist(ax=axes[0])
df.plot.scatter(x="col1", y="col2", ax=axes[1])
plt.tight_layout()
plt.savefig("plot.png", dpi=150)
plt.show()
VS Code Integration
- Install "Jupyter" extension
- Open
.ipynb files directly
- Select kernel from top-right dropdown
- Run cells with
Shift+Enter
- Variables panel: View → Variables