Skip to main content

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)

Metadata

Release files for weavecode 1.0.7

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

Source distribution (sdist)

Source distribution for weavecode 1.0.7
File Size Uploaded Provenance
weavecode-1.0.7.tar.gz 14.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 30.0 kB

Release files / weavecode-1.0.7.tar.gz

Download URL weavecode-1.0.7.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1af5d0db3fc564955887c317c406a509f3d416d466aa97975095e85545542140
BLAKE2b-256 checksum
How to use checksums
be24cb88601faaeef793231c9709e5d2b27f4cb6814ba194ea2b9ed50b0ceaf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Release files / weavecode-1.0.7-py3-none-any.whl

Download URL weavecode-1.0.7-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94c28018cd3fcfec4a0041bf1bd5a795046fdbbb10840ff2fa50d0f5cdf47f8e
BLAKE2b-256 checksum
How to use checksums
e063bba8f287d8225e7e709c34415e497b589f35116272ddd4828038a532f0cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Security for weavecode 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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