{"id":21771048,"url":"https://github.com/tomlin7/debug-adapter-client","last_synced_at":"2025-03-21T06:22:01.931Z","repository":{"id":249354938,"uuid":"826147913","full_name":"tomlin7/debug-adapter-client","owner":"tomlin7","description":"Client implementation for the Debug Adapter Protocol (https://microsoft.github.io/debug-adapter-protocol) that is used in IDEs, editors and other tools to communicate with different debuggers","archived":false,"fork":false,"pushed_at":"2024-07-20T09:23:38.000Z","size":772,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T03:13:39.589Z","etag":null,"topics":["adapter","code-editor","dap","debugger","debugger-api","debuggers","debugpy","editor","ide"],"latest_commit_sha":null,"homepage":"https://tomlin7.github.io/debug-adapter-client","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/tomlin7.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-09T07:04:54.000Z","updated_at":"2024-12-31T12:42:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6ea614a-5fbb-483a-9af2-dbaa890a3ef4","html_url":"https://github.com/tomlin7/debug-adapter-client","commit_stats":null,"previous_names":["tomlin7/dap","tomlin7/debug-adapter-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlin7%2Fdebug-adapter-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlin7%2Fdebug-adapter-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlin7%2Fdebug-adapter-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomlin7%2Fdebug-adapter-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomlin7","download_url":"https://codeload.github.com/tomlin7/debug-adapter-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244746779,"owners_count":20503261,"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":["adapter","code-editor","dap","debugger","debugger-api","debuggers","debugpy","editor","ide"],"created_at":"2024-11-26T14:14:52.858Z","updated_at":"2025-03-21T06:22:01.903Z","avatar_url":"https://github.com/tomlin7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [DAP Client: Debug Adapter Protocol Client for Python](https://tomlin7.github.io/dap/api-reference/)\n\nDAP Client is an up-to-date generic client side implementation of the [Debug Adapter Protocol (DAP)](https://microsoft.github.io/debug-adapter-protocol/) that is used in IDEs, editors and other tools to communicate with different debuggers. The client is not tied to any specific debugger, so it can be used to interact with any debug adapter that implements the DAP protocol, significantly reducing the effort required to build a new debugging tool. For a list of supported debug adapters, see the [official specification](https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/).\n\n## Key Features\n\n- **Sans I/O Implementation**: A protocol-only client that can be integrated into any I/O framework.\n- **Abstract Clients**: Ready-to-use threaded and asyncio clients for immediate integration.\n- **Flexible Architecture**: Easily extensible to support various debugging scenarios.\n\n## Table of Contents\n\n1. [Installation](#installation)\n2. [Quick Start](#quick-start)\n3. [Usage Examples](#usage-examples)\n4. [API Reference](https://tomlin7.github.io/dap/api-reference/)\n5. [License](#license)\n\n## Installation\n\nInstall DAP Client using pip:\n\n```bash\npip install dap-python\n```\n\n## Quick Start\n\nThe following example demonstrates how to use the async client to connect to a [`debugpy`](https://aka.ms/debugpy) debug adapter server that is running on port 1234.\n\n```bash\npython -m debugpy --listen localhost:1234 --wait-for-client hello.py\n```\n\n```python\nimport asyncio\nfrom dap import AsyncServer\n\nasync def main():\n    server = AsyncServer(\"debugpy\", port=1234)\n    try:\n        await server.start()\n    except asyncio.CancelledError:\n        await server.stop()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Usage Examples\n\n### Using the Sans I/O Client\n\nThe sans I/O client allows you to implement your own I/O mechanism:\n\n```python\nfrom dap import Client\nfrom dap.responses import Initialized\n\nclient = Client()\nclient.launch(no_debug=True)\n\n# get the request data\nrequest = client.send()\n\n# send the request using your I/O implementation\n# ...\n\n# feed the response data to the client\nfor result in client.receive(response_data):\n    if isinstance(result, Initialized):\n        print(\"The debug adapter is initialized.\")\n    ...\n```\n\n### Using the Threaded Socket IO Client\n\nThe threaded client provides a simple interface for synchronous usage:\n\n```python\nfrom dap import ThreadedServer\n\nserver = ThreadedServer(\"debugpy\", port=1234)\nserver.start()\nclient = server.client\n\n# Use the client synchronously\nclient.launch()\nclient.disconnect()\nserver.stop()\n```\n\n### Using the Asyncio Client\n\nThe asyncio client offers an asynchronous interface:\n\n```python\nimport asyncio\nfrom dap import AsyncServer\n\nasync def debug_session():\n    server = AsyncServer(\"debugpy\", port=1234)\n    server.start()\n    client = server.client\n\n    client.launch()\n    client.disconnect()\n    server.stop()\n\nasyncio.run(debug_session())\n```\n\n## License\n\nDAP Client is released under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomlin7%2Fdebug-adapter-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomlin7%2Fdebug-adapter-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomlin7%2Fdebug-adapter-client/lists"}