Giter Site home page Giter Site logo

camoryang / cyberbrain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laike9m/cyberbrain

0.0 1.0 0.0 913 KB

Python debugging, redefined.

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

License: MIT License

Python 69.36% Makefile 0.81% Shell 0.29% TypeScript 10.58% JavaScript 18.97%

cyberbrain's Introduction

Cyberbrain: Python debugging, redefined.

support-version PyPI implementation PyPI version shields.io

Cyberbrain is a Python debugging solution aiming to free programmers. It visualizes program execution and how each variable changes.

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

Install

Cyberbrain consists of a Python library and various editor/IDE integrations. Currently VS Code is the only supported editor, but we have plans to expand the support.

To install Cyberbrain:

pip install cyberbrain
code --install-extension laike9m.cyberbrain

Or if you prefer, install from PyPI and VS Code marketplace.

Or, you can try Cyberbrain directly from your browser: Open in Gitpod

How to Use

Suppose you want to trace a function called 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 execution.

The following gif demonstrates the workflow (click to view the full size image):

usage

Features provided:

  • Dataflow analysis
  • Variable tracing (try hover on any variable, it only highlights relevant variables)
  • Object inspection (value is logged in the opened devtools console)
  • Expect more to come 🀟

Read our documentation to learn more about Cyberbrain's features.

❗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:
    1. Kill the program by Ctrl+C (Cyberbrain will halt your program from exiting).
    2. 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) WIP
Live demo ready Cyberbrain can work with code you write in a live demo, in most cases Not started
Scripts ready Cyberbrain can work with most "scripting" programs Not started
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), remote debugging, trace dump
2.0 async support, including generators
3.0 Multi-frame tracing
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

    Cyberbrain and PySnooper share the same goal of reducing programmers' work while debugging. However they are fundamentally different: 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 visualizes data structures, while Cyberbrain visualizes your program execution (but also lets you inspect values)

Community

Join the Cyberbrain community Discord πŸ’¬ and follow us on Twitter @PyCyberbrain 🐦.

All questions & suggestions & discussions welcomed.

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 🀟!

sponsors

cyberbrain's People

Contributors

laike9m avatar dependabot[bot] avatar frostming avatar laixintao avatar

Watchers

James Cloos 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.