Name | wswebcam JSON |
Version |
1.1.0
JSON |
| download |
home_page | |
Summary | Access any serial device in your lan |
upload_time | 2022-12-08 18:23:21 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2022 Henrycke Schenberk - Parallax Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
webcam
opencv
streaming
websocket
localhost
image
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# WSWebcam
A WSWebcam é uma biblioteca para facilitar streaming de dispostivos de video via rede utilizando o protocolo websocket.
Sua arquitetura é baseada no modelo cliente/servidor. Onde o Dispotivo serial é o servidor e qualquer cliente que conheca seu endereço e porta pode se comunicar com ele.
## Uso/Exemplos
```python
# python -m wswebcam -h
usage: __main__.py [-h] [-c] [-s] [-p PORT] [-a ADDRESS] [-d DEVICE] [-v] [-g]
wswebcam - Websocket to WebcamBridge
options:
-h, --help show this help message and exit
-c, --client Run as a client
-s, --server Run as a server
-p PORT, --port PORT Port to listen on
-a ADDRESS, --address ADDRESS
Address to connect to (default: localhost)
-d DEVICE, --device DEVICE
Serial device to connect to (default: 0)
-v, --verbose Enable verbose logging
-g, --gui Run GUI to view the frame
```
#### Server - [Cmdlt, Instance and Context Manager]
```bash
# Start a server at 8050 with command line
python -m wswebcam -s -p 8050
```
```python
# Server as Instance
from wswebcam.server import Server
import asyncio
async def main():
await Server("0.0.0.0", 8050, 0).run()
asyncio.run(main())
```
```python
# Server as context manager]
from wswebcam.server import Server
import asyncio
async def main():
async with Server("0.0.0.0", 8050, 0) as server:
await asyncio.sleep(10)
asyncio.run(main())
```
#### Client - [Cmdlt, Instance and Context Manager]
```bash
# Connect a client on server at 0.0.0.0:8050
python -m wswebcam -c -a 0.0.0.0 -p 8050
```
```python
# Client as Instance
from wswebcam.client import Device as Client
from wswebcam.protocol import package
import asyncio
async def main():
await client = Client("ws://0.0.0.0:8050")
await client.connect()
await client.read()
await client.disconnect()
asyncio.run(main())
```
```python
# Client as context manager
from wswebcam.client import Camera as Client
import asyncio
async def main():
async with Client("ws://0.0.0.0:8050") as client:
await client.read()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "wswebcam",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "webcam,opencv,streaming,websocket,localhost,image",
"author": "",
"author_email": "Henrycke Bozza Schenberk <oschenberk@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1d/82/0c4357de2f2bbd2e43d67e51c825f8eb689b7364d0d828d477e87a8c378f/wswebcam-1.1.0.tar.gz",
"platform": null,
"description": "# WSWebcam\n\nA WSWebcam \u00e9 uma biblioteca para facilitar streaming de dispostivos de video via rede utilizando o protocolo websocket.\n\nSua arquitetura \u00e9 baseada no modelo cliente/servidor. Onde o Dispotivo serial \u00e9 o servidor e qualquer cliente que conheca seu endere\u00e7o e porta pode se comunicar com ele.\n\n## Uso/Exemplos\n```python\n# python -m wswebcam -h\nusage: __main__.py [-h] [-c] [-s] [-p PORT] [-a ADDRESS] [-d DEVICE] [-v] [-g]\n\nwswebcam - Websocket to WebcamBridge\n\noptions:\n -h, --help show this help message and exit\n -c, --client Run as a client\n -s, --server Run as a server\n -p PORT, --port PORT Port to listen on\n -a ADDRESS, --address ADDRESS\n Address to connect to (default: localhost)\n -d DEVICE, --device DEVICE\n Serial device to connect to (default: 0)\n -v, --verbose Enable verbose logging\n -g, --gui Run GUI to view the frame\n```\n\n#### Server - [Cmdlt, Instance and Context Manager]\n```bash\n # Start a server at 8050 with command line\n python -m wswebcam -s -p 8050\n```\n```python\n# Server as Instance\nfrom wswebcam.server import Server\nimport asyncio\n\nasync def main():\n await Server(\"0.0.0.0\", 8050, 0).run()\n\nasyncio.run(main())\n```\n```python\n# Server as context manager]\nfrom wswebcam.server import Server\nimport asyncio\n\nasync def main():\n async with Server(\"0.0.0.0\", 8050, 0) as server:\n await asyncio.sleep(10)\n\nasyncio.run(main())\n```\n#### Client - [Cmdlt, Instance and Context Manager]\n```bash\n # Connect a client on server at 0.0.0.0:8050\n python -m wswebcam -c -a 0.0.0.0 -p 8050 \n```\n```python\n# Client as Instance\nfrom wswebcam.client import Device as Client\nfrom wswebcam.protocol import package\nimport asyncio\n\nasync def main():\n await client = Client(\"ws://0.0.0.0:8050\")\n await client.connect()\n await client.read()\n await client.disconnect()\n\nasyncio.run(main())\n```\n```python\n# Client as context manager\nfrom wswebcam.client import Camera as Client\nimport asyncio\n\nasync def main():\n async with Client(\"ws://0.0.0.0:8050\") as client:\n await client.read()\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2022 Henrycke Schenberk - Parallax Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Access any serial device in your lan",
"version": "1.1.0",
"split_keywords": [
"webcam",
"opencv",
"streaming",
"websocket",
"localhost",
"image"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "fcbebe5c618f2acdf8f7243f4dcba1ff",
"sha256": "cc24ca4f0f9c2e3a060b8f8771fad9dfc973083886f74c704a2e9243d0e70d79"
},
"downloads": -1,
"filename": "wswebcam-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fcbebe5c618f2acdf8f7243f4dcba1ff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8154,
"upload_time": "2022-12-08T18:23:19",
"upload_time_iso_8601": "2022-12-08T18:23:19.044909Z",
"url": "https://files.pythonhosted.org/packages/0a/a1/bcc421a09f2864da94b0b1e609488f70b61f5e461b37821c805e5b8790a3/wswebcam-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "28704371036b5e0d6432483fe81b0403",
"sha256": "ad3036b65b43a39090e7fe82024d768b209630f1f245f96becf58eda84c5a54b"
},
"downloads": -1,
"filename": "wswebcam-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "28704371036b5e0d6432483fe81b0403",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8112,
"upload_time": "2022-12-08T18:23:21",
"upload_time_iso_8601": "2022-12-08T18:23:21.561715Z",
"url": "https://files.pythonhosted.org/packages/1d/82/0c4357de2f2bbd2e43d67e51c825f8eb689b7364d0d828d477e87a8c378f/wswebcam-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-08 18:23:21",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "wswebcam"
}