Skip to main content

Zero-dependency local Python tracer

Project description

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

Project details


Download files

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

Source Distribution

okernel-0.2.0.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

okernel-0.2.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file okernel-0.2.0.tar.gz.

File metadata

  • Download URL: okernel-0.2.0.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for okernel-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f0d13b4582b365ffd07f56f4f81fcb07d0d267eb18e1166a5e86b9f8594a5f88
MD5 e2297fc6502fc210f01fd86093acbcf1
BLAKE2b-256 e3f9efa2b42066ac9baab6e295da605f4d6d7de7dfb9b72905bb10a25968e12d

See more details on using hashes here.

File details

Details for the file okernel-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: okernel-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for okernel-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 639c85db92b7fa8a8e45ef1e15b9d7263a52ee4e09deef03c057661c6e0fefca
MD5 91991eb4fbb0b4e7215d05f8a5d313ad
BLAKE2b-256 66a6cfed657a63f4f66c48ed66dda941fa4e721773d5c25e067ad34320b45013

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