Skip to content

Instantly share code, notes, and snippets.

View snickell's full-sized avatar

Seth Nickell snickell

  • Big Island, Hawaii
View GitHub Profile
@snickell
snickell / current_jupyter.py
Last active April 20, 2020 23:59
Gets a reference to the current Jupyter Notebook and Server when run inside a Cell (also works for JupyterLab), can map kernel relative paths to files_urls
from pathlib import Path
import re
import requests
from urllib.parse import urljoin
import ipykernel
from notebook.notebookapp import list_running_servers
def files_url_for(kernel_path):
_server = server()