Python package that optimises AI-assisted coding.
Project description
PromptableTraceback
Overview
PromptableTraceback is a lightweight Python debugging library designed to optimise AI-assisted coding.
Why use it? When code fails, you typically spend a couple minutes gathering relevant lines of code, checking variable states, and copying the traceback into an LLM to help you debug. This library automates that process by capturing the "state of the world" at the exact moment of failure and formatting it into a clean, LLM-ready report.
Installation
Install PromptableTraceback via pip from PyPI:
pip install promptable-traceback
Requirements:
- Python 3.7+
- Works across Windows, MacOS, and Linux
Example Usage
Targeted monitoring: Use the @promptable_traceback.catch decorator to capture errors that occur within a specific function.
import promptable_traceback
@promptable_traceback.catch() # Initialise locally.
def my_func(var1):
var1 = int(var1) # Trigger an error.
my_func("frfr")
Universal monitoring: Use promptable_traceback.hook to capture any unhandled errors across your entire application.
import promptable_traceback
promptable_traceback.hook() # Initialise globally.
def my_func(var1):
var1 = int(var1) # Trigger an error.
my_func("frfr")
API Reference
The following parameters are available for targeted and universal monitoring.
context_window(int): The number of lines captured above and below the line of code which errored. Set to 25 by default. Note: This is capped by the boundaries of the function when using the decorator, or the boundaries of the file when using the hook.mask_secrets(bool): When set to True, variables containing sensitive data will have their values redacted. Set to True by default.
Suggestions & Feedback
I am always looking for ways to make this tool more useful for different development workflows.
If you have ideas for:
- Alternative invocation: Different ways to trigger the library into specific frameworks.
- Tailored reporting: Ideas for specific report formats that work better for certain LLMs or specialised debugging scenarios.
- Feature requests: Anything else that would make your debugging life easier.
Please feel free to open an issue or reach out!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptable_traceback-1.0.0.tar.gz.
File metadata
- Download URL: promptable_traceback-1.0.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa0b4157484b723dc9b189d71ba96d36a52f03d076a8bf12003c26002e248e85
|
|
| MD5 |
48a90bd42710883b5f77ff87975aadb6
|
|
| BLAKE2b-256 |
5f7a064f4a704200c589b5477d6f2320fc5a01207698ba89566f1de5904eb35a
|
Provenance
The following attestation bundles were made for promptable_traceback-1.0.0.tar.gz:
Publisher:
publish.yml on Repmak/promptable-traceback
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
promptable_traceback-1.0.0.tar.gz -
Subject digest:
fa0b4157484b723dc9b189d71ba96d36a52f03d076a8bf12003c26002e248e85 - Sigstore transparency entry: 788696946
- Sigstore integration time:
-
Permalink:
Repmak/promptable-traceback@56f80ab7624cd6a1a39dfc6af6c56466f1e0de16 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Repmak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56f80ab7624cd6a1a39dfc6af6c56466f1e0de16 -
Trigger Event:
release
-
Statement type:
File details
Details for the file promptable_traceback-1.0.0-py3-none-any.whl.
File metadata
- Download URL: promptable_traceback-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afbea65975751b23b4d67ede41a60136c4fc7cd675e0f79b2e83d30e020da42e
|
|
| MD5 |
147922d70869c068b50ff57e401bd047
|
|
| BLAKE2b-256 |
39f3c69457dd4d6506f37eed4bd0131b34e4ecb473773445091b8e95a07608d7
|
Provenance
The following attestation bundles were made for promptable_traceback-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on Repmak/promptable-traceback
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
promptable_traceback-1.0.0-py3-none-any.whl -
Subject digest:
afbea65975751b23b4d67ede41a60136c4fc7cd675e0f79b2e83d30e020da42e - Sigstore transparency entry: 788696949
- Sigstore integration time:
-
Permalink:
Repmak/promptable-traceback@56f80ab7624cd6a1a39dfc6af6c56466f1e0de16 -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Repmak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@56f80ab7624cd6a1a39dfc6af6c56466f1e0de16 -
Trigger Event:
release
-
Statement type: