# CODDE Protocol
[![actions status](https://img.shields.io/github/actions/workflow/status/PyO3/pyo3/ci.yml?branch=main&logo=github&style=)](https://github.com/codde-pi/codde_protocol/actions)
[![crates.io](https://img.shields.io/crates/v/pyo3?logo=rust)](https://crates.io/crates/codde_protocol)
[![pub.dev](https://img.shields.io/pub/v/flutter_rust_bridge.svg?include_prereleases&color=blue)](https://pub.dev/packages/codde_protocol)
[![pypi.org](https://img.shields.io/pypi/v/maturin.svg?logo=python&style=flat-square)](https://pypi.org/project/codde_protocol)
Multi Communication protocol in heart of the C.O.D.D.E. Pi framework.
This Project is written in Rust, enabling fast serializing/deserializing and data processing.
Client side is ported for Dart/Flutter applications, and server side has been translated in python.
<a href="https://www.buymeacoffee.com/wddm" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
CODDE Protocol integrates data generated by CODDE Pi App widgets, and received by embedded systems. See https://codde-pi.com to stay tuned about new widgets integration.
## Show me the code
With one code structure and a dozen of lines, you can receive data from socket, bluetooth of UART com. Just need a port address and registered actions on data is received :
```python
import codde_protocol
import time
server = CoddePiServer.use_socket('localhost:12345')
def action(*args):
widget: ToggleButton = args[0]
print("value received : ", widget.value)
server.callback(1, ServerStatus.Idle, ConfirmResult(True))
if __name__ == "__main__":
print('open server...')
server.open()
server.on(1, "ToggleButton", action)
# server.callback(1, cp.ServerStatus.Idle, cp.ConfirmResult(True))
server.serve()
time.sleep(2)
server.close()
```
## Roadmap
Protocols:
- [x] WebSocket
- [ ] Bluetooth
- [ ] UART
- [ ] HTTP
Raw data
{
"_id": null,
"home_page": "https://github.com/codde-pi/codde_protocol",
"name": "codde-protocol-client",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "rust, python, codde_pi, iot",
"author": "Mathis Lecomte <vm.lecomte@gmail.com>",
"author_email": "Mathis Lecomte <vm.lecomte@gmail.com>",
"download_url": null,
"platform": null,
"description": "# CODDE Protocol\n\n[![actions status](https://img.shields.io/github/actions/workflow/status/PyO3/pyo3/ci.yml?branch=main&logo=github&style=)](https://github.com/codde-pi/codde_protocol/actions)\n[![crates.io](https://img.shields.io/crates/v/pyo3?logo=rust)](https://crates.io/crates/codde_protocol)\n[![pub.dev](https://img.shields.io/pub/v/flutter_rust_bridge.svg?include_prereleases&color=blue)](https://pub.dev/packages/codde_protocol)\n[![pypi.org](https://img.shields.io/pypi/v/maturin.svg?logo=python&style=flat-square)](https://pypi.org/project/codde_protocol)\n\nMulti Communication protocol in heart of the C.O.D.D.E. Pi framework.\n\nThis Project is written in Rust, enabling fast serializing/deserializing and data processing.\nClient side is ported for Dart/Flutter applications, and server side has been translated in python.\n\n<a href=\"https://www.buymeacoffee.com/wddm\" target=\"_blank\"><img src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"></a>\n\nCODDE Protocol integrates data generated by CODDE Pi App widgets, and received by embedded systems. See https://codde-pi.com to stay tuned about new widgets integration.\n\n## Show me the code\n\nWith one code structure and a dozen of lines, you can receive data from socket, bluetooth of UART com. Just need a port address and registered actions on data is received :\n\n```python\n\nimport codde_protocol\nimport time\n\nserver = CoddePiServer.use_socket('localhost:12345')\n\ndef action(*args):\n widget: ToggleButton = args[0]\n print(\"value received : \", widget.value)\n server.callback(1, ServerStatus.Idle, ConfirmResult(True))\n\nif __name__ == \"__main__\":\n print('open server...')\n server.open()\n server.on(1, \"ToggleButton\", action)\n # server.callback(1, cp.ServerStatus.Idle, cp.ConfirmResult(True))\n server.serve()\n time.sleep(2)\n server.close()\n\n```\n\n## Roadmap\n\nProtocols:\n\n- [x] WebSocket\n- [ ] Bluetooth\n- [ ] UART\n- [ ] HTTP\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Multi Communication protocol in heart of the C.O.D.D.E. Pi framework",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/codde-pi/codde_protocol"
},
"split_keywords": [
"rust",
" python",
" codde_pi",
" iot"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c4ae0c6a41baf739d100023560f88b3fd874e2381545becaaebf30a96cfaf6ea",
"md5": "99cf1b10fb1bfb0e6df2be6872353072",
"sha256": "9a0170b3062ceb36b5018d8ce88fd2e5cfe415538396f2e01f28095d685da67b"
},
"downloads": -1,
"filename": "codde_protocol_client-0.1.3-cp38-abi3-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "99cf1b10fb1bfb0e6df2be6872353072",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 392369,
"upload_time": "2024-04-08T09:18:09",
"upload_time_iso_8601": "2024-04-08T09:18:09.217811Z",
"url": "https://files.pythonhosted.org/packages/c4/ae/0c6a41baf739d100023560f88b3fd874e2381545becaaebf30a96cfaf6ea/codde_protocol_client-0.1.3-cp38-abi3-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-08 09:18:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "codde-pi",
"github_project": "codde_protocol",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "codde-protocol-client"
}