Skip to main content

Python toolkit for Jupyter runtimes, powered by runtimed Rust binaries

Project description

runtimed

Python toolkit for Jupyter runtimes, powered by runtimed Rust binaries. Execute code, manage kernels, and interact with notebooks programmatically.

Installation

pip install runtimed

Note: The 2.0 release is currently in pre-release. Use pip install --pre runtimed (or uv pip install --prerelease allow runtimed) to get the latest 2.x build matching the nteract desktop nightly.

Quick Start

Synchronous API

import runtimed

with runtimed.Session() as session:
    session.start_kernel()
    result = session.run("print('hello')")
    print(result.stdout)  # "hello\n"

Async API

import asyncio
import runtimed

async def main():
    async with runtimed.AsyncSession() as session:
        await session.start_kernel()
        result = await session.run("print('hello async')")
        print(result.stdout)

asyncio.run(main())

Features

  • Code execution via daemon-managed kernels
  • Sync and async APIs for flexibility
  • Document-first model with automerge sync
  • Multi-client support for shared notebooks
  • Rich output capture (stdout, stderr, display_data, errors)

Session API

session = runtimed.Session(notebook_id="my-notebook")
session.start_kernel()

# Simple execution
result = session.run("x = 42")

# Document-first pattern (for fine-grained control)
cell_id = session.create_cell("print(x)")
result = session.execute_cell(cell_id)

# Inspect results
print(result.success)
print(result.stdout)
print(result.error)

# Save the notebook to disk
path = session.save()                       # Save to current path
path = session.save(path="/tmp/copy.ipynb")  # Save-as

# Reorder cells
new_position = session.move_cell(cell_id, after_cell_id="other-id")

AsyncSession API

async with runtimed.AsyncSession(notebook_id="my-notebook") as session:
    await session.start_kernel()
    result = await session.run("x = 42")

    # Or document-first pattern
    cell_id = await session.create_cell("print(x)")
    result = await session.execute_cell(cell_id)

    # Save the notebook to disk
    path = await session.save()                       # Save to current path
    path = await session.save(path="/tmp/copy.ipynb")  # Save-as

    # Reorder cells
    new_position = await session.move_cell(cell_id, after_cell_id="other-id")

DaemonClient API

client = runtimed.DaemonClient()
client.ping()        # Health check
client.status()      # Pool statistics
client.list_rooms()  # Active notebooks

Requirements

  • runtimed daemon running (see CLAUDE.md — use cargo xtask dev-daemon for development or cargo xtask install-daemon for the system service)
  • Python 3.10+

Documentation

See docs/python-bindings.md for full documentation.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

runtimed-2.0.1a202603162144-cp39-abi3-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.9+Windows x86-64

runtimed-2.0.1a202603162144-cp39-abi3-manylinux_2_39_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.39+ x86-64

runtimed-2.0.1a202603162144-cp39-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file runtimed-2.0.1a202603162144-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: runtimed-2.0.1a202603162144-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for runtimed-2.0.1a202603162144-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 86d5db751c7e191fa171bb6b8d0c3179ae3961c0e42599bb5be4f3aad45e1bbe
MD5 88884fc0abb87c9a8a03480c36e18bcc
BLAKE2b-256 8860782326ffa0f6a407d9657c88e061b80415156be368a229aeefe941336238

See more details on using hashes here.

File details

Details for the file runtimed-2.0.1a202603162144-cp39-abi3-manylinux_2_39_x86_64.whl.

File metadata

  • Download URL: runtimed-2.0.1a202603162144-cp39-abi3-manylinux_2_39_x86_64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.39+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for runtimed-2.0.1a202603162144-cp39-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 01ca6d93d1dff6902b2ae554d64de6b194aa1bf49cc686046dd4f8d461dd7984
MD5 cc299aabb868a4366b175b85c4b83d96
BLAKE2b-256 ca0788e3d9f0f1c6e4b2a1fe2dac1cdb027a8b1ad3d34cb746415dd414d713e4

See more details on using hashes here.

File details

Details for the file runtimed-2.0.1a202603162144-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: runtimed-2.0.1a202603162144-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for runtimed-2.0.1a202603162144-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 92d32dc19df0c62b01796bd4b05099d912c2f21de125939e08c72cbe003ab401
MD5 11ca687ee9714786ee8ba22a1d68d25f
BLAKE2b-256 9c4b087b3b43d68a0667ab004dcb2a165d0a1bb0f6732d85b381dcf7e51b42bb

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