Package: cyberbrain
Cyberbrain: Python debugging,redefined.Cyberbrain1(电子脑) aims to free programmers from debugging. It lets you:Backtrace variable changes.Seeevery stateof program execution, includingvariables' valuesDebug loopswith confidence.Never spend hours stepping through a program, let Cyberbrain tell you what happened.Read moreabout existing features, androadmapsfor features to come.I gave a talk at PyCascades 2021 about Cyberbrain,watch it here.InstallCyberbrain consists of a Python library and various editor/IDE integrations. Currently it supportsVS CodeandGitpod. See ourplanon expanding the support.To install Cyberbrain:pip install cyberbrain
code --install-extension laike9m.cyberbrainYou can also install fromPyPI,VS Code marketplaceorOpen VSX.Or, you can try Cyberbrain online:How to UseSuppose you want to trace a functionfoo, just decorate it with@trace:fromcyberbrainimporttrace# As of now, you can only have one @trace decorator in the whole program.# We may change this in version 2.0, see https://github.com/laike9m/Cyberbrain/discussions/73@trace# Disable tracing with `@trace(disabled=True)`deffoo():...Cyberbrain keeps your workflow unchanged. You run a program (from vscode or command line, both work), 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 ourdocumentationto 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).If you have multiple VS Code window opened, the trace graph will always be created in the first one.#72is tracking this issue.When having multiple decorators, you should put@traceas the innermost one.@app.route("/")@tracedefhello_world():x=[1,2,3]return"Hello, World!"RoadmapsUpdated 2020.11Cyberbrain is new and under active development, bugs are expected. If you met any, pleasecreate an issue. At this point, you shouldNOTuse Cyberbrain in production. We'll release 1.0 when it's ready for production.Major features planned for future versions are listed below. It may change over time.VersionFeatures1.0Code & trace interaction (#7), API specification2.0Multi-frame tracing (👉I need your feedback for this feature)3.0asyncsupport, remote debugging4.0Fine-grained symbol tracing5.0Multi-threading supportVisit the project'skanbanto learn more about the current development schedule.How does it compare to other tools?PySnooperPySnooperand 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 VisualizerDebug visualizerand Cyberbrain have different goals. Debug visualizer visualizes data structures, while Cyberbrain visualizes program execution (but also lets you inspect values).Python TutorPython Tutoris for education purposes, you can't use it to debug your own programs. It's a brilliant tool for its purpose and I do it like it very much.Static analysisCyberbrain is *NOT* static analyis. It's runtime tracing. Static analysis can't provide enough information for debugging.Community💬GitHub Discussions(for general discussions)🤖Discord(for more instant discussions. I'm happy to chat any time!)🐦Twitter@PyCyberbrain(for announcements)Interested in Contributing?See thedevelopment guide. This project follows theall-contributorsspecification.Contributions of ANY kind welcome!Thanks goes to these wonderful contributors ✨Alex Hall🤔Frost Ming🐛📖Funloading💻Ikko Ashimine💻Kaustubh Gupta📝Ram Rachum🤔Siyuan Xu🐛Victor Sun💻🤔dingge2016💵💻foo bar💵inkuang🐛laixintao📖yihong💵🤔林玮 (Jade Lin)🐛🤔SupportCyberbrain is a huge and complicated project that will last for years, but once finished, it will reshape how people think and do debugging. Your support can help sustain it. Let's make it the best Python debugging tool 🤟!:heart: Sponsor on GitHub1: The name of this project originates fromGhost in the Shell,quote:Cyberizationis the process whereby a normal brain is physically integrated with electronic components to produce an augmented organ referred to as acyberbrain.