Skip to main content

okernel

Zero-dependency Python tracer with HTML visualization.

Installation

pip install okernel

Quick Start

import okernel

code = """
def factorial(n):
    return 1 if n <= 1 else n * factorial(n-1)

print(factorial(5))
"""

# Generate trace and visualize
trace = okernel.trace(code)
trace.to_html("trace.html")
# Output: Generated trace.html with 24 steps

Features

  • Zero external dependencies (Python stdlib only)
  • Rich trace events with memory, timing, hardware costs
  • 3-panel HTML visualizer:
    • Code view with line highlighting
    • Stack/Heap inspector
    • Timeline with memory chart
  • Security: No innerHTML, programmatic DOM creation
  • Works offline - generates self-contained HTML files

API

okernel.trace(code: str) -> Trace

Executes code string and returns a Trace object containing execution events, memory stats, and timing data.

Trace.to_html(path: str)

Generates a self-contained HTML visualizer at the specified path.

Trace.summary() -> str

Returns a text summary of execution metrics (steps, peak memory, duration).

Trace.events

List of raw execution events (line changes, calls, returns, opcode costs).

Links

Release files for okernel 0.2.0

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

Source distribution (sdist)

Source distribution for okernel 0.2.0
File Size Uploaded
okernel-0.2.0.tar.gz 21.8 kB Details

Built distribution (wheel)

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

Total release size: 46.4 kB

Release files / okernel-0.2.0.tar.gz

Download URL okernel-0.2.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f0d13b4582b365ffd07f56f4f81fcb07d0d267eb18e1166a5e86b9f8594a5f88
BLAKE2b-256 checksum
How to use checksums
e3f9efa2b42066ac9baab6e295da605f4d6d7de7dfb9b72905bb10a25968e12d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / okernel-0.2.0-py3-none-any.whl

Download URL okernel-0.2.0-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
639c85db92b7fa8a8e45ef1e15b9d7263a52ee4e09deef03c057661c6e0fefca
BLAKE2b-256 checksum
How to use checksums
66a6cfed657a63f4f66c48ed66dda941fa4e721773d5c25e067ad34320b45013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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