@asyncapi/template-python-websocket-client
v0.0.1
Published
This is a template generating Python websocket client
Readme
Python WebSocket Client
You can test this template:
- Clone the project and run
npm install - Navigate to
packages/templates/clients/python/websocket - Install with
npm installand run test withnpm run test - Go to test folder with
cd test - Install dependencies of the generated client:
pip install -r temp/snapshotTestResult/requirements.txt - Start example script that uses a client library generated by the test:
python example.py
By default this is testing against Postman echo service. You can modify
packages/templates/clients/python/websocket/example.pyand change first line tofrom temp.snapshotTestResult.client_hoppscotch import HoppscotchEchoWebSocketClientand line 16client = HoppscotchEchoWebSocketClient()and runpython example.pyagain. You will see example still works but agains different API. This is possible as both AsyncAPI documents have the same name of operation for sending messages:sendEchoMessageso each client generated has the same API.
