Python debugging, redefined.
Project description
Cyberbrain: Python debugging, redefined.
Cyberbrain aims to free programmers from debugging. It is the only debugger that:
-
Backtraces variable changes.
-
Persists every state of program execution.
-
Preserves variables' values without truncating them.
-
Lets you debug loops with confidence.
Read more about these features.
Never spend hours stepping through a program, let Cyberbrain tell you what happened.
Install
Cyberbrain consists of a Python library and various editor/IDE integrations. Currently it supports VS Code and Gitpod. See our plan on expanding the support.
To install Cyberbrain:
pip install cyberbrain
code --install-extension laike9m.cyberbrain
You can also install from PyPI , VS Code marketplace or Open VSX .
Or, you can try Cyberbrain online:
How to Use
Suppose you want to trace a function foo
, just decorate it with @trace
:
from cyberbrain import trace
@trace # You can disable tracing with `@trace(disabled=True)`
def foo():
...
Cyberbrain keeps your workflow unchanged. You run a program (from vscode or command line, both work), call "Initialize Cyberbrain" from the command palette, and a new panel will be opened to visualize how your program executed.
The following gif demonstrates the workflow (click to view the full size image):
Read our documentation to learn more about Cyberbrain's features and limitations.
❗Note on use❗
- Cyberbrain may conflict with other debuggers. If you set breakpoints and use VSC's debugger, Cyberbrain may not function normally. Generally speaking, prefer "Run Without Debugging" (like shown in the gif).
- To run Cyberbrain multiple times with different programs, you need to:
- Kill the program by Ctrl+C (Cyberbrain will halt your program from exiting).
- Run another program.
- Run "Initialize Cyberbrain" again.
Status Quo and Milestones
Updated 2020.10
Cyberbrain is new and under active development, bugs are expected. If you met any, I appreciate if you can create an issue. At this point, you should NOT use Cyberbrain in production.
Milestones for the project are listed below, which may change over time. Generally speaking, we'll release 1.0 when it reaches "Production ready".
Milestone | Description | Status |
---|---|---|
Examples ready | Cyberbrain works on examples (in the examples/ folder) |
✔️ |
Scripts ready | Cyberbrain can work with most "scripting" programs | WIP |
Announcement ready | Cyberbrain is ready to be shared on Hacker News and Reddit. Please don't broadcast Cyberbrain before it reaches this milestone. | Not started |
Production ready | Cyberbrain can work with most programs in production | Not started |
Note that v1.0 means Cyberbrain is stable in the features it supports, it does NOT mean Cyberbrain is feature complete. Major features planned for each future version are listed below. Again, expect it to change at any time.
Version | Features |
---|---|
1.0 | Code & trace interaction (#7), API specification |
2.0 | Multi-frame tracing |
3.0 | async support, remote debugging |
4.0 | Fine-grained symbol tracing |
5.0 | Multi-threading support |
Visit the project's kanban to learn more about the current development schedule.
How does it compare to other tools?
PySnooper
PySnooper and Cyberbrain share the same goal of reducing programmers' work while debugging, with a fundamental difference: Cyberbrain traces and shows the sources of each variable change, while PySnooper only logs them. The differences should be pretty obvious after you tried both.Debug Visualizer
Debug visualizer and Cyberbrain have different goals. Debug visualizer visualizes data structures, while Cyberbrain visualizes program execution (but also lets you inspect values).Community
- 💬 GitHub Discussions (for general discussions)
- 🤖 Discord (for more instant discussions. I'm happy to chat any time!)
- 🐦 Twitter @PyCyberbrain (for announcement)
Interested in Contributing?
Get started here.
Support
I'm almost working full time (besides my regular job) on Cyberbrain. This project is huge, complicated and will last for years, however it will reshape how people think and do debugging. That's why I need your support. Let's make it the best Python debugging tool 🤟!
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
Hashes for cyberbrain-0.0.9.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ea31e63754c0e41108dc71a8b0dcbd4feeeaf7d49eb04072547549895b5f7c1 |
|
MD5 | 0748c07e81797ec2af8167934c134600 |
|
BLAKE2b-256 | 2678eaf3ee46a03e3fae7fa5436a935d8872a9c05c8dc35d361ffbdaa33f86d0 |