Skip to main content

Local JSONL logging and git snapshotting for Weave traces

Project description

weavecode

Local JSONL logging and terminal UI for Weights & Biases Weave traces — with git snapshotting so you can replay exactly what code ran at each trace.

Install

pip install weavecode

Usage

import weave
import weavecode

# 1. Init weave as normal, then wrap with weavecode
client = weave.init("my-project")
weavecode.init(client, git_path="/path/to/your/repo")

# 2. Decorate functions you want to trace
@weave.op
def my_function(prompt: str) -> str:
    ...

# 3. Run your code
my_function("hello")

Every call is logged locally to ~/.cache/codeweave/<project>/ as a JSONL file, with a git snapshot of your repo at the time of the run.

View traces

weavecode
# or pass a project name directly:
weavecode my-project

This opens a terminal UI with:

  • Runs list — all logged runs for the selected project, with 📸 if a git snapshot exists
  • Call tree — the full trace tree for the selected run
  • Source viewer — the exact source code at snapshot time, with the traced function and callsite highlighted
  • Detail panel — inputs, outputs, errors, git info, and a clickable W&B link

Keybindings

Key Action
p Pick project (modal list)
r Back to runs list
1 / 2 Focus runs / calls panel
c Copy trace to clipboard
o Open trace in W&B browser
j Jump to callsite in VS Code
q Quit

Git snapshotting

When you pass git_path, weavecode commits a snapshot of your repo at the start of each run (stashing any dirty changes first). The snapshot SHA is stored in each log entry. The source viewer uses git show <sha>:<file> to display the code — it never modifies your working tree.

Requirements

  • Python >= 3.8
  • textual >= 0.50.0
  • weave (Weights & Biases)

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

weavecode-1.0.7.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

weavecode-1.0.7-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file weavecode-1.0.7.tar.gz.

File metadata

  • Download URL: weavecode-1.0.7.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for weavecode-1.0.7.tar.gz
Algorithm Hash digest
SHA256 1af5d0db3fc564955887c317c406a509f3d416d466aa97975095e85545542140
MD5 a1b8841ab715ece46b05d386d57b5a87
BLAKE2b-256 be24cb88601faaeef793231c9709e5d2b27f4cb6814ba194ea2b9ed50b0ceaf1

See more details on using hashes here.

File details

Details for the file weavecode-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: weavecode-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for weavecode-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 94c28018cd3fcfec4a0041bf1bd5a795046fdbbb10840ff2fa50d0f5cdf47f8e
MD5 3b0d355cded42e845008772cacceee13
BLAKE2b-256 e063bba8f287d8225e7e709c34415e497b589f35116272ddd4828038a532f0cb

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