{"id":13468641,"url":"https://github.com/laike9m/Cyberbrain","last_synced_at":"2025-03-26T05:31:14.145Z","repository":{"id":37622927,"uuid":"249303697","full_name":"laike9m/Cyberbrain","owner":"laike9m","description":"Python debugging, redefined.","archived":false,"fork":false,"pushed_at":"2022-12-30T22:40:02.000Z","size":1898,"stargazers_count":2507,"open_issues_count":41,"forks_count":159,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-10-29T15:35:17.692Z","etag":null,"topics":["debugging","python"],"latest_commit_sha":null,"homepage":"http://bit.ly/cyberbrain-features","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laike9m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"laike9m","custom":"www.buymeacoffee.com/cyberbrain"}},"created_at":"2020-03-23T00:59:43.000Z","updated_at":"2024-10-17T05:04:44.000Z","dependencies_parsed_at":"2023-01-31T17:00:26.361Z","dependency_job_id":null,"html_url":"https://github.com/laike9m/Cyberbrain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2FCyberbrain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2FCyberbrain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2FCyberbrain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laike9m%2FCyberbrain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laike9m","download_url":"https://codeload.github.com/laike9m/Cyberbrain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245048276,"owners_count":20552483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","python"],"created_at":"2024-07-31T15:01:15.519Z","updated_at":"2025-03-26T05:31:12.892Z","avatar_url":"https://github.com/laike9m.png","language":"Python","funding_links":["https://github.com/sponsors/laike9m","www.buymeacoffee.com/cyberbrain","https://www.buymeacoffee.com/cyberbrain"],"categories":["Python","开源工具","工具","Python (1887)"],"sub_categories":["好用工具","Python 参考项目"],"readme":"# Cyberbrain: Python debugging, **redefined**.\n\n[![support-version](https://img.shields.io/pypi/pyversions/cyberbrain)](https://img.shields.io/pypi/pyversions/cyberbrain)\n[![PyPI implementation](https://img.shields.io/pypi/implementation/cyberbrain.svg)](https://pypi.org/project/cyberbrain/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/cyberbrain.svg)](https://pypi.org/project/cyberbrain/)\n[![\"GitHub Discussions\"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true\u0026logo=github\u0026colorB=purple)](https://github.com/laike9m/Cyberbrain/discussions)\n[![Discord](https://img.shields.io/discord/751695524628922449.svg?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/5zGS5V5)\n[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social\u0026label=@PyCyberbrain)](https://twitter.com/PyCyberbrain)\n\nCyberbrain\u003csup\u003e[1](#footnote1)\u003c/sup\u003e(电子脑) aims to free programmers from debugging. It lets you:\n\n- **Backtrace variable changes**.\n\n- See **every state** of program execution, including **variables' values**\n\n- **Debug loops** with confidence.\n\nNever spend hours stepping through a program, let Cyberbrain tell you what happened.\n\n![](https://user-images.githubusercontent.com/2592205/95418789-1820b480-08ed-11eb-9b3e-61c8cdbf187a.png)\n\n[Read more](docs/Features.md) about existing features, and [roadmaps](#roadmaps) for features to come.\n\nI gave a talk at PyCascades 2021 about Cyberbrain, **[watch it here](https://www.youtube.com/watch?v=eXlTVrNZ67Q)**.\n\n## Install\n\nCyberbrain consists of a Python library and various editor/IDE integrations. Currently it supports **[VS Code](https://code.visualstudio.com/)** and **[Gitpod](https://www.gitpod.io/)**. See our [plan](https://github.com/laike9m/Cyberbrain/issues/24) on expanding the support.\n\nTo install Cyberbrain:\n\n```\npip install cyberbrain\ncode --install-extension laike9m.cyberbrain\n```\n\nYou can also install from [PyPI](https://pypi.org/project/cyberbrain/) , [VS Code marketplace](https://marketplace.visualstudio.com/items?itemName=laike9m.cyberbrain) or [Open VSX](https://open-vsx.org/extension/laike9m/cyberbrain) .\n\n**Or, you can try Cyberbrain online:** [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#snapshot/f19f41cd-08ce-40be-a668-f7d61b7083da)\n\n## How to Use\n\nSuppose you want to trace a function `foo`, just decorate it with `@trace`:\n\n```python\nfrom cyberbrain import trace\n\n# As of now, you can only have one @trace decorator in the whole program.\n# We may change this in version 2.0, see https://github.com/laike9m/Cyberbrain/discussions/73\n\n@trace  # Disable tracing with `@trace(disabled=True)`\ndef foo():\n    ...\n```\n\nCyberbrain 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.\n\nThe following gif demonstrates the workflow (click to view the full size image):\n\n![usage](https://user-images.githubusercontent.com/2592205/98645630-1d579180-22e7-11eb-8860-3a844f58a252.gif)\n\nRead our **[documentation](docs/Features.md)** to learn more about Cyberbrain's features and limitations.\n\n❗Note on use❗\n- 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).\n- If you have multiple VS Code window opened, the trace graph will always be created in the first one. [#72](https://github.com/laike9m/Cyberbrain/discussions/72) is tracking this issue.\n- When having multiple decorators, you should put `@trace` as the innermost one. \n  ```python\n  @app.route(\"/\")\n  @trace\n  def hello_world():\n      x = [1, 2, 3]\n      return \"Hello, World!\"\n  ```\n\n## Roadmaps\n\n*Updated 2020.11*\n\nCyberbrain is new and under active development, bugs are expected. If you met any, please [create an issue](https://github.com/laike9m/Cyberbrain/issues/new). At this point, you should **NOT** use Cyberbrain in production. We'll release 1.0 when it's ready for production.\n\nMajor features planned for future versions are listed below. It may change over time.\n\n| Version | Features                        |\n|:-------:|---------------------------------|\n| 1.0     | Code \u0026 trace interaction ([#7][m1]), API specification |\n| 2.0     | Multi-frame tracing (👉 [I need your feedback for this feature](https://github.com/laike9m/Cyberbrain/discussions/73))   |\n| 3.0     | `async` support, remote debugging |\n| 4.0     | Fine-grained symbol tracing     |\n| 5.0     | Multi-threading support |\n\n[m1]: https://github.com/laike9m/Cyberbrain/issues/7\n\nVisit the project's [kanban](https://github.com/laike9m/Cyberbrain/projects/1) to learn more about the current development schedule.\n\n## How does it compare to other tools?\n\n\u003cdetails\u003e\n\u003csummary\u003ePySnooper\u003c/summary\u003e\n\u003ca href=\"https://github.com/cool-RR/PySnooper\"\u003ePySnooper\u003c/a\u003e 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.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDebug Visualizer\u003c/summary\u003e\n\u003ca href=\"https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer\"\u003eDebug visualizer\u003c/a\u003e and Cyberbrain have different goals. Debug visualizer visualizes data structures, while Cyberbrain visualizes program execution (but also lets you inspect values).\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePython Tutor\u003c/summary\u003e\n\u003ca href=\"http://pythontutor.com/\"\u003ePython Tutor\u003c/a\u003e 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.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eStatic analysis\u003c/summary\u003e\nCyberbrain is *NOT* static analyis. It's runtime tracing. Static analysis can't provide enough information for debugging.\n\u003c/details\u003e\n\n\n## Community\n\n- 💬 **[GitHub Discussions](https://github.com/laike9m/Cyberbrain/discussions)** (for general discussions)\n- 🤖 **[Discord](https://discord.gg/5zGS5V5)** (for more instant discussions. I'm happy to chat any time!)\n- 🐦 **Twitter [@PyCyberbrain](https://twitter.com/PyCyberbrain)** (for announcements)\n\n## Interested in Contributing?\nSee the [development guide](https://github.com/laike9m/Cyberbrain/blob/master/docs/Development.md). This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. **Contributions of ANY kind welcome!**\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nThanks goes to these wonderful contributors ✨\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/alex-hall-8532079a/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/3627481?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlex Hall\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-alexmojaki\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://frostming.com\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/16336606?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFrost Ming\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/issues?q=author%3Afrostming\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/laike9m/Cyberbrain/commits?author=frostming\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://cocacolf.now.sh/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/25732253?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFunloading\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/commits?author=CocaColf\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://bandism.net/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/22633385?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eIkko Ashimine\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/commits?author=eltociear\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.kaustubhgupta.xyz/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/43691873?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKaustubh Gupta\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#blog-kaustubhgupta\" title=\"Blogposts\"\u003e📝\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://ram.rachum.com\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/56778?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRam Rachum\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-cool-RR\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/no1xsyzy\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/7346170?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSiyuan Xu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/issues?q=author%3Ano1xsyzy\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://victorjzsun.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/17478849?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVictor Sun\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/commits?author=victorjzsun\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-victorjzsun\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dingge2016\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/20748513?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edingge2016\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#financial-dingge2016\" title=\"Financial\"\u003e💵\u003c/a\u003e \u003ca href=\"https://github.com/laike9m/Cyberbrain/commits?author=dingge2016\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/poltronSuperstar\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/22001372?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003efoo bar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#financial-poltronSuperstar\" title=\"Financial\"\u003e💵\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/inkuang\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/38498747?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003einkuang\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/issues?q=author%3Ainkuang\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.kawabangga.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/9675939?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003elaixintao\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/commits?author=laixintao\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://yihong.run\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/15976103?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eyihong\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#financial-yihong0618\" title=\"Financial\"\u003e💵\u003c/a\u003e \u003ca href=\"#ideas-yihong0618\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://linw1995.com/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/13523027?v=4?s=30\" width=\"30px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e林玮 (Jade Lin)\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/laike9m/Cyberbrain/issues?q=author%3Alinw1995\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"#ideas-linw1995\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n\n## Support\n\nCyberbrain 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 🤟!\n\n[:heart: Sponsor on GitHub](https://github.com/sponsors/laike9m)\n\n[![](https://www.buymeacoffee.com/assets/img/guidelines/download-assets-1.svg)](https://www.buymeacoffee.com/cyberbrain)\n\n\u003ca name=\"footnote1\"\u003e\u003csup\u003e1\u003c/sup\u003e\u003c/a\u003e: The name of this project originates from *[Ghost in the Shell](https://en.wikipedia.org/wiki/Ghost_in_the_Shell)*, [quote](https://ghostintheshell.fandom.com/wiki/Cyberbrain):\n\n\u003e **Cyberization** is the process whereby a normal brain is physically integrated with electronic components to produce an augmented organ referred to as a **cyberbrain**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaike9m%2FCyberbrain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaike9m%2FCyberbrain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaike9m%2FCyberbrain/lists"}