Skip to main content

No project description provided

Project description

Jupyter Client Fun

Learning how to use the jupyter_client API to interact with jupyter kernels.

Mental Model

This is a program that can be used to interact with kernels. For example, quarto interacts with kernels. This is not code relating to the implementation of a jupyter kernel.

Jupyter Plugin Goal

  • Listing all kernels that are available in the kernelspec list
  • Run an arbitrary block of code in our kernel

Jupyter Notebook Visualization

Before we can even go ahead and write a plugin for dealing with notebooks, We need to actually visualize a given notebook.

Question: How???

How the hell are we going to actually visualize this? In it's own buffer. Anytime we open up a new ipynb document, we need to open up a new custom popup buffer. Let's start there.

Lua Implementation

  • Get a jupyter notebook into this project.
  • Create a new popup buffer when we open up a notebook file.

Python Implementation

  • Startup a new program that can write contents to nvim
  • Load in a notebook using the nbformat library
  • Add new code or markdown cells
  • Display the cells of a given notebook
    • Display cell's outputs
    • Convert markdown to a clean format using render-markdown.nvim
  • Actually execute the code inside of a single cell
  • Write the cells of a jupyter notebook to an nvim buffer

Design Goals

Ok, I don't want to just spin around in circles so let's try and think about precisely what I want to accomplish

Viewing Jupyter Notebooks

Before we even start to think about interactivity (which is definitely a design goal!!), we want to first be able to OPEN a jupyter notebook in nvim.

When we open up a notebook for now we see a giant json document - well because that's precisely what a notebook is - but I'd much rather see the markdown alongside code - like what we see in a traditional editor. I don't want to have to leave my editor to view the contents of a notebook.

Architecture

We are going to use an editable markdown file to represent a jupyter notebook.

When opening up a new jupyter notebook, we are going to actually open up the markdown file.

We can use that markdown file to execute jupyter code.

Hopefully we will eventually be able to execute any code that we want in this markdown file.

Goals

  • Convert a jupyter notebook to a markdown representation
  • Execute the cells in our kernel
  • Support multiple kernels in a single markdown file.

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

jupyter_http_manager-0.1.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_http_manager-0.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file jupyter_http_manager-0.1.1.tar.gz.

File metadata

  • Download URL: jupyter_http_manager-0.1.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Linux/6.2.0-39-generic

File hashes

Hashes for jupyter_http_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9948bf6121fb9660724f3e06f455eb554116da69c892d9d39394e197f7b27514
MD5 816e0e7ecde9b83a88cbb513d7e05587
BLAKE2b-256 e08cabbfbea057422cfefee2cccc61310fbef6c4a3c600fe73f640bc78b54160

See more details on using hashes here.

File details

Details for the file jupyter_http_manager-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jupyter_http_manager-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Linux/6.2.0-39-generic

File hashes

Hashes for jupyter_http_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b98d46bc39258dddb3550aacedde00f49cfb82fd8b9e495213dbbf1b9e92fce
MD5 f43e7fa2315277baa16d9f2e53a3fec6
BLAKE2b-256 3b17e483950280753c828b127f8aa31825e7662359a9df0d809e82ba3c27d38d

See more details on using hashes here.

Supported by

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