Coder Social home page Coder Social logo

trendingtechnology / cyberbrain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laike9m/cyberbrain

0.0 2.0 0.0 1.32 MB

Python debugging, redefined.

Home Page: http://bit.ly/cyberbrain-features

License: MIT License

Python 74.97% Makefile 0.87% Shell 0.27% TypeScript 7.96% JavaScript 15.94%

cyberbrain's Introduction

Cyberbrain: Python debugging, redefined.

support-version PyPI implementation PyPI version shields.io "GitHub Discussions" Discord

Cyberbrain aims to free programmers from debugging. It lets you:

  • Backtraces variable changes.

  • See every state of program execution, including variables' values

  • Debug loops with confidence.

Never spend hours stepping through a program, let Cyberbrain tell you what happened.

Read more about existing features, and roadmaps for features to come.

Install

Cyberbrain consists of a Python library and various editor/IDE integrations. Currently it supports VS Code. 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.

How to Use

Suppose you want to trace a function foo, just decorate it with @trace:

from cyberbrain import trace

# 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)`
def foo():
    ...

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):

usage

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).
  • If you have multiple VS Code window opened, the trace graph will always be created in the first one. #72 is tracking this issue.
  • When having multiple decorators, you should put @trace as the innermost one.
    @app.route("/")
    @trace
    def hello_world():
        x = [1, 2, 3]
        return "Hello, World!"

Roadmaps

Updated 2020.11

Cyberbrain is new and under active development, bugs are expected. If you met any, please create an issue. At this point, you should NOT use 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.

Version Features
1.0 Code & trace interaction (#7), API specification
2.0 Multi-frame tracing (๐Ÿ‘‰ I need your feedback for this feature)
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).
Python Tutor Python Tutor is 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.

Community

Interested in Contributing?

See the development guide. This project follows the all-contributors specification. Contributions of ANY kind welcome!

All Contributors

Thanks goes to these wonderful contributors โœจ


laixintao

๐Ÿ“– ๐Ÿ’ต

yihong

๐Ÿ’ต ๐Ÿค”

dingge2016

๐Ÿ’ต

Frost Ming

๐Ÿ› ๐Ÿ“–

ๆž—็Žฎ (Jade Lin)

๐Ÿ› ๐Ÿค”

Alex Hall

๐Ÿค”

inkuang

๐Ÿ›

Siyuan Xu

๐Ÿ›

Ram Rachum

๐Ÿค”

foo bar

๐Ÿ’ต

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 ๐ŸคŸ!

โค๏ธ Sponsor on GitHub

cyberbrain's People

Contributors

allcontributors[bot] avatar dependabot[bot] avatar frostming avatar laike9m avatar laixintao avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.