Skip to main content

ipymini

ipymini is a Python-only Jupyter kernel for Python with a small(ish), readable(ish) codebase and strong IPython parity.

This was almost entirely implemented by AI, and no human currently fully understands all the generated code, so please be very careful, because we don't actually know what this code does. The AI closely referenced the ipykernel, xeus, xeus-python, and jupyter_kernel_test projects during development. So all credit for this project belongs to the authors of those packages, and to authors of the excellent documentation and specifications referred to (e.g DAP spec; JEPs; etc) - but of course all blame for mistakes is entirely our/AI's fault.

Having said all that, we have been working on this and testing it for ~6 months before making it public, and it is working well for our needs at least (Mac and Linux usage on nbclassic and Solveit). We have restructured it a number of times to make it more modular and understandable, and added a lot of tests of concurrency, complex workflows, etc.


What we’ve aimed to do

  • Implement a full Jupyter kernel in pure Python.
  • Match ipykernel behavior where it matters (IOPub ordering, message shapes, history, inspect, etc.).
  • Use IPython instead of re‑implementing Python semantics.
  • Expand protocol‑level tests (IOPub, interrupts, completions, etc.) to approach upstream parity.

Requirements

  • Python 3.11+
  • jupyter_client, jupyter_core, ipython, pyzmq

If you need system ZMQ libs on macOS:

brew install libzmq

Install

From PyPI:

pip install ipymini

Wheel installs include a kernelspec in the environment, so Jupyter from that environment should discover ipymini without a separate install step.

Installing the kernel spec

For editable installs, use the built-in installer. It copies the repo kernelspec into a Jupyter kernels directory.

python -m ipymini install --user

Or install into the current environment:

python -m ipymini install --sys-prefix

After either option, you should see it in:

jupyter kernelspec list

Alternatively, use the repo’s JUPYTER_PATH during development. Set JUPYTER_PATH to include the repo’s share/jupyter:

export JUPYTER_PATH=/path/to/ipymini/share/jupyter:$JUPYTER_PATH

Running manually

ipymini is a normal Jupyter kernel executable. It expects a connection file:

python -m ipymini -f /path/to/connection.json

(When run via Jupyter, that file is created and passed automatically.)


Concurrent execution helpers

Inside an ipymini cell, get_ipython().kernel.unlock() lets queued shell messages run while the current cell awaits. get_ipython().kernel.subshell() is a context manager that routes later execute requests from the same client session to a temporary subshell:

with get_ipython().kernel.subshell():
    await something()

The same helpers are also available as from ipymini import unlock, subshell.


Configuring env and working directory

For per-launch configuration, rely on the kernel launcher:

  • KernelManager: pass env and cwd to start_kernel(...).
  • Kernelspec: add an "env" dict to share/jupyter/kernels/ipymini/kernel.json for static defaults.

Example (KernelManager):

from jupyter_client import KernelManager

km = KernelManager(kernel_name="ipymini")
km.start_kernel(env={"MY_FLAG": "1"}, cwd="/path/to/workdir")

Optional env flags:

  • KERNMINI_STOP_ON_ERROR_TIMEOUT: seconds to keep aborting queued executes after an error (default 0.0).
  • KERNMINI_HOLD_TIMEOUT: seconds before a parked hold execute completes as an error (default 3600; see kernmini's DEV.md).

On POSIX, ipymini isolates the kernel into its own process group and terminates that group as the last shutdown step, so user-created child processes are cleaned up with the kernel. Nested ipymini kernels started by KernelManager watch their parent pid and shut themselves down when that parent exits. Direct SIGTERM to the kernel uses the same cleanup path. Windows does not provide this process-group cleanup guarantee; after normal cleanup the kernel process exits with os._exit().


Developer guide

See DEV.md.

Release files for ipymini 0.1.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipymini 0.1.20
File Size Uploaded
ipymini-0.1.20.tar.gz 25.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipymini 0.1.20
File Interpreter ABI Platform
ipymini-0.1.20-py3-none-any.whl Python 3 none any Details

Total release size: 51.1 kB

Release files / ipymini-0.1.20.tar.gz

Download URL ipymini-0.1.20.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5bac20dda8e4e0dbb8a0ca9c9066af07d7a4dfde1ec0f917b1359da3d9f9e573
BLAKE2b-256 checksum
How to use checksums
8b613d632d74ba5a225bcc6f9b761b1ed9e9f5dde05817b16afcb795f3637cc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / ipymini-0.1.20-py3-none-any.whl

Download URL ipymini-0.1.20-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d05aa6caffb7d97a24a8d2515e8d78a474b8dd09d924fd3f62848f5d6ef5521b
BLAKE2b-256 checksum
How to use checksums
49905384f6ae7d4abcd581c03684148bbe03c5d2e97f2a39097de4907b3679af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

This release

0.1.20 This release

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page