codde-protocol


Namecodde-protocol JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/codde-pi/codde_protocol
SummaryMulti Communication protocol in heart of the C.O.D.D.E. Pi framework
upload_time2024-02-23 23:14:45
maintainer
docs_urlNone
authorMathis Lecomte <vm.lecomte@gmail.com>
requires_python>=3.8
license
keywords rust python codde_pi iot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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_pi_protocol as cp
import time

server = cp.CoddePiServer.use_socket('localhost:12345')

def action(*args):
    widget: cp.ToggleButton = args[0]
    print("value received : ", widget.value)
    server.callback(1, cp.ServerStatus.Idle, cp.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] Socket
- [ ] Bluetooth
- [ ] UART
- [ ] HTTP


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/codde-pi/codde_protocol",
    "name": "codde-protocol",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "rust,python,codde_pi,iot",
    "author": "Mathis Lecomte <vm.lecomte@gmail.com>",
    "author_email": "Mathis Lecomte <vm.lecomte@gmail.com>",
    "download_url": "",
    "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_pi_protocol as cp\nimport time\n\nserver = cp.CoddePiServer.use_socket('localhost:12345')\n\ndef action(*args):\n    widget: cp.ToggleButton = args[0]\n    print(\"value received : \", widget.value)\n    server.callback(1, cp.ServerStatus.Idle, cp.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] Socket\n- [ ] Bluetooth\n- [ ] UART\n- [ ] HTTP\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Multi Communication protocol in heart of the C.O.D.D.E. Pi framework",
    "version": "0.1.1",
    "project_urls": {
        "Changelog": "https://github.com/codde-pi/codde_protocol/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/codde-pi/codde_protocol",
        "Issues": "https://github.com/codde-pi/codde_protocol/issues",
        "Repository": "https://github.com/codde-pi/codde_protocol.git"
    },
    "split_keywords": [
        "rust",
        "python",
        "codde_pi",
        "iot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "32b5c112f1e43b4f0957288e30c929c38b572c77d32981b3dfb7ebf07654d7c4",
                "md5": "ca24aaf4e2b89c183a2880bb13aea8e4",
                "sha256": "ccb538e07911c34385d4db9af4ed3b5016a4dac21132063dfcaebb2320f2be29"
            },
            "downloads": -1,
            "filename": "codde_protocol-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ca24aaf4e2b89c183a2880bb13aea8e4",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 1379171,
            "upload_time": "2024-02-23T23:14:45",
            "upload_time_iso_8601": "2024-02-23T23:14:45.298594Z",
            "url": "https://files.pythonhosted.org/packages/32/b5/c112f1e43b4f0957288e30c929c38b572c77d32981b3dfb7ebf07654d7c4/codde_protocol-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-23 23:14:45",
    "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"
}
        
Elapsed time: 0.19721s