Skip to main content

Python toolkit for Jupyter runtimes, powered by runtimed Rust binaries

Project description

runtimed

Python bindings for the runtimed notebook daemon. Execute code, manage kernels, and interact with notebooks programmatically.

Installation

pip install runtimed

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

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

DaemonClient API

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

Requirements

  • runtimed daemon running (runt daemon start)
  • Python 3.9+

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.1a202603111846-cp39-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9+Windows x86-64

runtimed-2.0.1a202603111846-cp39-abi3-manylinux_2_39_x86_64.whl (4.1 MB view details)

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

runtimed-2.0.1a202603111846-cp39-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: runtimed-2.0.1a202603111846-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.1a202603111846-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4efb6b3fc22809540d54458f8eca7b1c56b6be458d6c92a1e7416f35479d6383
MD5 45ab5feb57e076304a64a97ec289ceea
BLAKE2b-256 4d46cdd036d5fe8f4ea748782fdf3cc15694a0d3361841712f3157a9bb7f3de5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: runtimed-2.0.1a202603111846-cp39-abi3-manylinux_2_39_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.39+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.1a202603111846-cp39-abi3-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 32f799413dc334a4f52af97c10833340774d9f81db3842449f0dae78f646f91d
MD5 9b981e8c095dd261ae9780be01b5c1b4
BLAKE2b-256 3251a6ba7cf301b45dda0847501b5f4411302bae63e59222b4b101ffdf1469ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: runtimed-2.0.1a202603111846-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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.1a202603111846-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34c992bfd9703ae1bdcd943cdf9a7a7f1faa65446ea17e25b15ad8781607b2d2
MD5 5287ca6c71661cac1725dfd6ca9f1d76
BLAKE2b-256 553bd57982958f58d69b23e118dbe20b0eb851add981eac2e633a85f31901488

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