{"id":13815408,"url":"https://github.com/quantopian/qdb","last_synced_at":"2025-04-05T11:10:55.084Z","repository":{"id":18549143,"uuid":"21750533","full_name":"quantopian/qdb","owner":"quantopian","description":"Quantopian Remote Debugger for Python","archived":false,"fork":false,"pushed_at":"2023-09-25T18:50:34.000Z","size":281,"stargazers_count":314,"open_issues_count":6,"forks_count":118,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-03-29T10:09:53.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quantopian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-07-11T20:33:35.000Z","updated_at":"2025-02-27T07:37:59.000Z","dependencies_parsed_at":"2024-01-12T03:36:20.406Z","dependency_job_id":"5733e988-8f34-4c5e-9bbc-84db4669e709","html_url":"https://github.com/quantopian/qdb","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/quantopian%2Fqdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantopian%2Fqdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantopian%2Fqdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantopian%2Fqdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quantopian","download_url":"https://codeload.github.com/quantopian/qdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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":[],"created_at":"2024-08-04T04:03:27.297Z","updated_at":"2025-04-05T11:10:55.066Z","avatar_url":"https://github.com/quantopian.png","language":"Python","readme":"# qdb #\n[![build status](https://travis-ci.org/quantopian/qdb.png?branch=master)](https://travis-ci.org/quantopian/qdb)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/quantopian/qdb?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\nRemote Debugger for Python\n\nqdb powers the in-browser debugger at [Quantopian](https://www.quantopian.com/posts/new-feature-debugging-in-the-ide)\n\n### Overview ###\n\nqdb is a debugger for python that allows users to debug code executing\non remote machine. qdb is split into three main components that may all be\nrunning on separate hardware:\n\n- The client\n- The tracer\n- The server\n\nThe client is the user's interface to the debugger. All communication here is\nthrough a websocket connected to the server. This client could be any type\nof application. qdb provides a terminal client and emacs mode for this.\n\n\nThe tracer is the main debugging process. This is the actual code that the user\nwishes to debug. Communication here is through a socket sending json\nobjects representing only the valid messages sent to the server from\nthe client. A single tracer may have multiple clients connected to it.\n\n\nThe server is the main routing station for messages between the clients and the\ntracer. The server is responsible for validating that the messages from the\nclients are well formed and routing them to the tracer. A single server may\nmanage multiple tracers, so it is responsible for making sure that connections\nare routed to the proper place. The server can clean up tracer processes whose\nclients have become inactive if the server manager decides. The server may also\nimpose authentication rules to allow or disallow some connections.\n\n\n### Getting started ###\n\nTo debug a process with qdb locally, first you must start the server process.\n\nThe easiest way to do this is to execute:\n\n    $ python -m qdb.server\n\nwhich will start up a server that accepts tracer connections on port 8001, and\nclient connections on port 8002. There are a few options that may be passed to\nthe server from the command line, to see a full list, run:\n\n    $ python -m qdb.server --help\n\n\nNow that you have a server running, you may run a process under qdb.\nAs an example, try saving the following as qdb_test.py:\n\n```python\nfrom qdb import set_trace, RemoteCommandManager\n\n\ndef f():\n    in_f = True\n    return 'getting out of f'\n\n\ndef main():\n    set_trace(\n        uuid='qdb',\n        host='localhost',\n        port=8001,\n        cmd_manager=RemoteCommandManager(),\n    )\n    mutable_object = {}\n    print 'Hello world!'\n    f()\n    print mutable_object\n\n\nif __name__ == '__main__':\n    main()\n```\n\nThen, invoke the program as you normally would with:\n\n    $ python qdb_test.py\n\nFinally, you will need to connect your client to the server so that you can\nactually debug the program. To connect, run the provided client found in the\nclient directory with:\n\n    $ qdb-cli\n\nBefore you are finished, you will need to get the output from the program, in a\nseperate terminal, run:\n\n    $ tail -f /tmp/qdb/.qdb\n\nThis will be the realtime output from the debugger.\n\n\nYou are now ready to debug your process, issue the `help` command in the repl\nto see a list of available commands and functions, or begin evaluating python\ncode in the context of the other process.\n\n\n## Contributions ##\n\nIf you would like to contribute, please see our\n[Contribution Requests](https://github.com/quantopian/qdb/wiki/Contribution-Requests).\n\n\n### Requirements ###\n\nTo download the requirements, you can simply issue:\n\n    $ make requirements\n\nassuming you have pip installed. You will most likely want to install into a\nvirtualenv.\n\nTo view the development and normal requirements, see etc/requirements_dev.txt\nand etc/requirements.txt.\n\n\n### Style ##\nTo ensure that changes and patches are focused on behavior changes, the qdb\ncodebase adheres to both PEP-8, http://www.python.org/dev/peps/pep-0008/, and\npyflakes, https://launchpad.net/pyflakes/.\n\nThe maintainers check the code using\nthe flake8 script, https://bitbucket.org/tarek/flake8/wiki/Home, which is\nincluded in the etc/requirements_dev.txt.\n\nBefore submitting patches or pull requests, please ensure that running\n`make style` and `make test` both pass.\n\n\n## Source ##\n\nThe source for qdb is hosted at: https://github.com/quantopian/qdb\n\n\n### Contact ###\n\nFor other questions, please contact opensource@quantopian.com.\n","funding_links":[],"categories":["Python","\u003ca id=\"324874bb7c3ead94eae6f1fa1af4fb68\"\u003e\u003c/a\u003eDebug\u0026\u0026调试"],"sub_categories":["\u003ca id=\"d22bd989b2fdaeda14b64343b472dfb6\"\u003e\u003c/a\u003e工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantopian%2Fqdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantopian%2Fqdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantopian%2Fqdb/lists"}