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(oruv 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-daemonfor development orcargo xtask install-daemonfor 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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file runtimed-2.0.3a202603202220-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: runtimed-2.0.3a202603202220-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16ea4e509810daad713392cc3644f001fc526e365e46aed93e85c09c3834ce43
|
|
| MD5 |
e29c16d370e44cccae2bbde23516e9c5
|
|
| BLAKE2b-256 |
36189198a05575516ac989da5dc6310f42f7b1aa77f9990ee477f4ba344e27c9
|
File details
Details for the file runtimed-2.0.3a202603202220-cp39-abi3-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: runtimed-2.0.3a202603202220-cp39-abi3-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.9+, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f41e9872f21b559e54e8db641e938f6bd158780d6aecb5ae7d08c5f6d8afd79c
|
|
| MD5 |
d83317e575d74f1dc9fc79322ad35bd2
|
|
| BLAKE2b-256 |
c833111607dabbe19c7e54099b614c4239647a37f1e294dd03b1315fef157ce3
|
File details
Details for the file runtimed-2.0.3a202603202220-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: runtimed-2.0.3a202603202220-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.12 {"installer":{"name":"uv","version":"0.10.12","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3370ebd6cf71040e3a2da5a33cbde797b7a75fc741375d534cf20c2440abdfe
|
|
| MD5 |
0521c95bd96139c9e1aca4def8b79652
|
|
| BLAKE2b-256 |
c44e7f6be6dd5d1fe3067e0cd159eea8ab5938f744197ad2b90d914c2b1a1ac9
|