Skip to main content

A concurrent python kernel for Jupyter supporting AnyIO, AsyncIO and Trio.

Project description

Async kernel

pypi downloads CI Ruff uv basedpyright - checked Built with Material for MkDocs codecov

logo-svg

Async kernel is a Python Jupyter kernel with concurrent message handling.

Messages are processed fairly whilst preventing asynchronous deadlocks by using a unique message handler per channel, message_type and subshell_id.

Highlights

[^gui note]: A gui event loop is provided by starting the event loop (host) and then running an asynchronous backend as a guest in the event loop. Kernel messaging is performed as usual in the asynchronous backend. For this reason it is not possible to enable a gui event loop at runtime.

[^gui caller note]: It is also possible to use a caller to run a gui event loop in a separate thread (with a backend running as a guest) if the gui allows it (qt will only run in the main thread). Also note that pyplot will only permit one interactive gui library in a process.

[^asyncio guest]: The asyncio implementation of start_guest_run was written by the author of aiologic and provided as a (gist).

Documentation

Installation

pip install async-kernel

Kernel specs

A kernel spec with the name 'async' is added when async kernel is installed.

Kernel specs can be added/removed via the command line.

The kernel is configured via the interface with the options:

Backends

The backend defines the asynchronous library provided in the thread in which it is running.

  • asyncio
  • trio

Example - change kernel spec to use trio

pip install trio
async-kernel -a async --interface.backend=trio

Gui event loop

The kernel can be started with a gui event loop as the host and the backend running as a guest.

asyncio backend

# tk
async-kernel -a async-tk --interface.loop=tk

# qt
pip install PySide6-Essentials
async-kernel -a async-qt --interface.loop=qt

trio backend

pip install trio
# tk
async-kernel -a async-tk --interface.loop=tk --interface.backend=trio

# qt
pip install PySide6-Essentials
async-kernel -a async-qt --interface.loop=qt --interface.backend=trio

For further detail about kernel spec customisation see command line usage.

Origin

Async kernel started as a fork of IPyKernel. Thank you to the original contributors of IPyKernel that made Async kernel possible.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async_kernel-0.12.3.tar.gz (304.6 kB view details)

Uploaded Source

Built Distribution

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

async_kernel-0.12.3-py3-none-any.whl (105.9 kB view details)

Uploaded Python 3

File details

Details for the file async_kernel-0.12.3.tar.gz.

File metadata

  • Download URL: async_kernel-0.12.3.tar.gz
  • Upload date:
  • Size: 304.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for async_kernel-0.12.3.tar.gz
Algorithm Hash digest
SHA256 16973e72d8de40a26a83884deb8ec0cda746225ce53f427997db7382af2d3408
MD5 4a0bfc53726674f89442cfef7adc0c2d
BLAKE2b-256 4d6ac30d1e4a3ca2fd1311d440574a00cb9b9a88772ed26edc4e6e7d9a880ed5

See more details on using hashes here.

Provenance

The following attestation bundles were made for async_kernel-0.12.3.tar.gz:

Publisher: publish-to-pypi.yml on fleming79/async-kernel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file async_kernel-0.12.3-py3-none-any.whl.

File metadata

  • Download URL: async_kernel-0.12.3-py3-none-any.whl
  • Upload date:
  • Size: 105.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for async_kernel-0.12.3-py3-none-any.whl
Algorithm Hash digest
SHA256 18ac33f23ae315a4c1ead845366a3c1ebc26d2dea40382dd87b0ef736c886622
MD5 663e0bf50f8e432beefa9ea7015c3f5d
BLAKE2b-256 3cd6fa8b591bc2677be87979a736423080aba4082899eb9b981eb7c8ce578f2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for async_kernel-0.12.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on fleming79/async-kernel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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