--- id: keke version: "0.2.0" license: MIT license_treatment: permissive maintenance: active --- # keke — Easy profiling in chrome trace format License: permissive · Maintenance: active · Downloads: 563.6K/mo ## What it is and what it does keke is a minimal trace-event writer that outputs performance profiling data in the Perfetto/Chrome trace format, readable in Chrome's about:tracing or Perfetto UI. It wraps code sections with context managers that record timing and metadata, then writes the results to a JSON file compatible with both tools. The library is designed to be small enough to vendor into other projects and has near-zero overhead when disabled (by passing file=None). It supports basic distributed tracing through manual process coordination—you manage unique identifiers and file names across child processes, then merge traces afterward. It depends only on psutil and is licensed under MIT, making it suitable for inclusion in other projects. Use it for: - Profile Python application performance and visualize execution timelines in Chrome DevTools - Add lightweight tracing to CLI tools or services without heavy profiling overhead - Coordinate multi-process tracing by passing trace file paths or identifiers to child processes - Vendor into a project as a fallback profiling option without adding significant dependencies - Identify performance bottlenecks in specific code sections with named trace spans ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Writes trace events in Perfetto/Chrome trace format for performance profiling, with minimal overhead and optional output. Yes, if you need lightweight Chrome trace format output for profiling. The low install friction, permissive MIT license, active maintenance, and minimal dependencies make it practical for inclusion in projects. Not suitable if you need line-level profiling (consider viztracer instead) or distributed tracing out of the box. ## Install pip install keke uv add keke poetry add keke ## Installing keke Before you install: Low install friction with a single runtime dependency (psutil). Active maintenance with recent releases; last commit 2026-04-07. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for vendoring into other projects. Quickstart: pip install keke import keke from keke import kev with keke.TraceOutput(file=open('trace.json', 'w')): with kev('task_name', __name__): # code to profile pass Requires Python 3.8 or later; development and linting tested on 3.10-3.12. Verify before relying: - Whether psutil is required at runtime or only for optional features - Exact performance overhead when tracing is enabled vs. disabled - Compatibility with Python 3.7 despite requires_python>=3.8 claim in description ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 563.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags chrome trace format profiling, perfetto trace writer, python performance tracing, trace event output, lightweight profiler, distributed tracing support, profiling, tracing, performance-analysis [View on SkillFed](https://skillfed.io/packages/keke) · [View on PyPI](https://pypi.org/project/keke/)