{ "info": { "author": "john Tourtellott", "author_email": "john.turtle@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: ISC License (ISCL)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# SideGears desktop app runtime\n\nhttps://gitlab.com/john.tourtellott/sidegears\n\nSideGears is a set of lightweight tools for creating desktop\napplications that consist of an html/css/javascript UI with a\npython backend. The toolset has two parts\n\n* Python kernel for backend processing and platform access. The python\n kernel is available from pypi (\"pip install sidegears\").\n* Javascript client for browser-based user interface. The javascript\n client is available from npmjs (\"npm install sidegears\").\n\nThe two halves connect through a standard websocket and\ncommunicate via json-rpc messages. In the typical use case, the\nuser interface -- running in a browser -- calls methods in the kernel via\nthe sidegears API. See examples in the npm package, including one that uses the\npython webruntime library to launch a browser instance from python.\n\nSideGears supports 3 of the 4 RPC transport cases:\n\n* RPC request from the javascript client to the python kernel.\n* RPC notification from client to kernel.\n* RPC notification from kernel to client.\n\nSideGears does *not* support RPC requests from the kernel to the\nclient. This can be added, but is not considered needed for the\nenvisioned desktop applications.\n\n## Python Kernel\nThe sidegears kernel uses the standard websockets module that runs in\nthe asyncio event loop. The kernel has two public objects:\n\n```\nfrom sidegears.kernel import RPCKernel, rpc_method\n```\n\nKernel methods are:\n\n* `start(self, host='localhost', port='5678', close_on_disconnect=False)`\n Start the kernel, listening for client connections on the specified\n host and port. When the `close_on_disconnect` flag is set, the kernel\n will run until the client connection closes. (This call is not\n blocking.)\n* `stop(self)` Stop the kernel, terminating any websocket connections.\n* `wait_until_closed(self)` Returns a future that resolves when the\n kernel has stopped. This method is used when the close_on_connection\n flag is set when the kernel is started.\n* `send_notification(self, method, params=None)` Send a notification\n message to the client.\n* `set_basic_logging(self, enabled)` Enable logging of the RPC messages\n sent and received.\n* `set_debug(self, enabled)` Enabled debug options in the json RPC\n server.\n* `set_trim_log_values(self, enabled)` When basic logging is enabled,\n shorten the messages logged to the console.\n\nApplication RPC methods are designated by using the `rpc_method`\ndecorator, for example:\n\n```\n@rpc_method\nasync def multiply(x, y):\n return x*y\n```\n\nNote that RPC methods must be defined with the async keyword.\n\nSource code for several examples applications that run the kernel\nand launch a browser/UI are included in the package distribution files.\nYou can find these in the python site-packages/sidegears folder.\n\n## Javascript Client Packages\n\nThe javascript libraries are used in conjunction with the\ncorresponding python sidegears package. When the python\nsidegears kernel is running, the sidegears js library can connect\nto the kernel and make functions calls (which are transported as\njson-rpc messages over websockets.)\n\nThere are four packages in the dist folder:\n\n* sidegears.js : UMD format, for running in browser or bundled with\n common js applications. This is the default package entry point.\n* sidegears.esm.js : ES6 package for bundling into large applications\n* sidegears-plugin.js : UMD format for Vue applications in browser or\n commonjs\n* sidegears-plugin.esm.js : ES6 format for Vue applications, for\n bunding into applications\n\n### Javascript UI/Client\n\nFor starndard html pages, use `sidegears.js` or `sidegears.esm.js`,\ndepending on your bundling format. The API is very small, and used\nin the examples/client/client.html file. The API methods are:\n\n* `sidegears.connect(host='localhost', port=5678)` opens the connection\n to the kernel. The method returns a promise object, which must\n resolve before calling methods on the kernel.\n\n* `sidegears.disconnect()` closes the connection to the kernel. For\n desktop apps, this can be called in response to the window\n `beforeunload` event, although there is no guarantee it will be\n executed before the window closes.\n\n* `sidegears.requester` returns a proxy object that can be used to make\n make RPC request calls directly. In brief, calling\n `sidegears.requester.method(params)` is equivalent to calling\n `sidegears.sendRequest(method, params)`.\n\n* `sidegears.notifier` returns a proxy object for making RPC\n notification calls directly. Calling\n `sidegears.notifier.method(params)` is equivalent to calling\n `sidegears.sendNotification(method, params)`.\n\n* `sidegears.sendRequest(method, parameters)` makes an rpc call to the\n kernel, returning a promise object that resolves with the reply or\n error. The \"method\" argument is a string, and the \"parameters\" are\n passed to the method when it is executed in the kernel. Only\n parameters that can be json serialized can be used.\n\n* `sidegears.sendNotification(method, parameters)` makes an rpc call to\n the kernel, but unlike reqest calls, there is no return from rpc\n notification calls. The \"method\" argument is a string, and the\n \"parameters\" are passed to the method when it is executed in the\n kernel. Only parameters that can be json serialized can be used.\n\n* `sidegears.onNotify` is used to set a function to be called when\n notification messages are received from the python kernel.\n\n### Vue API\n\nFor Vue.js applications, you can use the `sidegears-plugin.js` and\n`sidegears-plugin.esm.js` files, which implement a Vue.js plugin.\nWhen installed, the plugin injects a global Vue.$\\_sidegears object.\nThe plugin object has the same basic methods as described above for the\nstandard API. From Vue components:\n\n* `this.$\\_sidegears.connect(host='localhost', port=5678)`\n* `this.$\\_sidegears.disconnect()`\n* `this.$\\_sidegears.sendRequest(method, params)`\n* `this.$\\_sidegears.sendNotification(method, params)`\n\nOther methods are:\n\n* `$_sidegears.isOpen()` returns a boolean indication whether the\n client is connected to the kernel or not.\n\n* `$_sidegears.getRequestProxy()` returns a proxy object that can make\n RPC request calls directly (same as the javascript requester).\n\n* `$_sidegears.getNotifyProxy()` returns a proxy object that can make\n RPC notification calls directly (same as the javascript notifier).\n\nIn addition, a custom `notification` event is emitted when a notification message is\nreceived from the kernel. The event arguments are the accompanying\nmethod and parameters.\n\n## Background\n\nIn some ways, SideGears is analogous to application frameworks such\nas Electron and NW.js, which also provide an html/js/css user\ninterface.\n\n* The main difference is that SideGears uses a python backend,\n whereas Electron and NW.js use nodejs.\n* Also, in Electron and NW.js, the UI and nodejs logic are tightly\n coupled through a single event loop; whereas the SideGears UI and\n backend run in separate event loops, and\n can be run in separate processes. (Theoretically, SideGears\n frontend and backend can run on different machines, although this is\n not officially supported.)\n* SideGears can be used with an existing browser for the UI,\n or in an application an embedded browser.\n\nFinally, if anyone is curious where the term SideGears comes from:\n\n* \"Side\" refers to PySide, which is the original name of the Qt for\n Python [1] project. Our initial implementations use the PySide\n QWebEngine library for the UI rendering engine (although we have\n moved on to webruntime). SideGears is also a \"side\" project for the\n author.\n* \"Gears\" refers to TurboGears [2], a well-established web framework\n that takes a \"best of breed\" approach, combining existing tools into\n a cohesive system. We like their approach and try to emulate it. We\n also want to portray our project as a small set of software tools,\n not a full-scale \"platform\" or \"framework\".\n\n[1] Qt for Python is at https://www.qt.io/qt-for-python\n\n[2] TurboGears is at http://www.turbogears.org/", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/john.tourtellott/sidegears", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "sidegears", "package_url": "https://pypi.org/project/sidegears/", "platform": "", "project_url": "https://pypi.org/project/sidegears/", "project_urls": { "Homepage": "https://gitlab.com/john.tourtellott/sidegears" }, "release_url": "https://pypi.org/project/sidegears/0.1.6/", "requires_dist": null, "requires_python": "", "summary": "Tools for browser-based desktop applications", "version": "0.1.6" }, "last_serial": 5740333, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4b8138169b23beb33eed3649ed3cf567", "sha256": "d9e74b3fd75aabb3fcdcf0189b0c587451b2370d4a1d2224d90c8ea0200bc632" }, "downloads": -1, "filename": "sidegears-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4b8138169b23beb33eed3649ed3cf567", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12200, "upload_time": "2019-07-01T00:51:16", "url": "https://files.pythonhosted.org/packages/5b/71/29ca1dab661c957c7228ec10317dfc597a4cf6640c76b0517cd0bf712092/sidegears-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "cd046aa762607e415a9db65fe8efe07e", "sha256": "d0092c4d0cc2b0956aad4e3077e4d3725a11e509698f5e0358b88d4bac99e603" }, "downloads": -1, "filename": "sidegears-0.1.1.tar.gz", "has_sig": false, "md5_digest": "cd046aa762607e415a9db65fe8efe07e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12320, "upload_time": "2019-07-02T02:47:06", "url": "https://files.pythonhosted.org/packages/67/69/ec2629d4a3b0ca7be13e53286433b50cecae5234efd93efaef499913c538/sidegears-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "78fc502c27568357ea6ab9dfe1cb19d5", "sha256": "dd66002ffc7a478aaaa29509b473e54f792898f7716d097a44afcba309e1eef0" }, "downloads": -1, "filename": "sidegears-0.1.2.tar.gz", "has_sig": false, "md5_digest": "78fc502c27568357ea6ab9dfe1cb19d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12365, "upload_time": "2019-07-03T00:24:01", "url": "https://files.pythonhosted.org/packages/f7/ce/64524098ac93250dfcb33b9a8e485f97088650d4bab5738c3f4ca167bdcd/sidegears-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "34bc2fb511643638b3a4b01476b8e184", "sha256": "1b33ccbaf1b2d8a0794d0459537c7bbce81d381a134544f1ca6cdc48836d1629" }, "downloads": -1, "filename": "sidegears-0.1.3.tar.gz", "has_sig": false, "md5_digest": "34bc2fb511643638b3a4b01476b8e184", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13129, "upload_time": "2019-07-07T19:38:40", "url": "https://files.pythonhosted.org/packages/78/3a/0dfbd53131adf6844388b73e22dd40829c8870ae5da84991c177ac4d586a/sidegears-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d669db1c7d5782d4ee6bc73fa12f8057", "sha256": "46c6e5f9d0ede87154b94b1b9b913e70f5f238ade3e03d562c0bc486c4ddc939" }, "downloads": -1, "filename": "sidegears-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d669db1c7d5782d4ee6bc73fa12f8057", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13390, "upload_time": "2019-07-08T03:35:11", "url": "https://files.pythonhosted.org/packages/cc/06/4913c5fc7139560dd9f65bf6443efd4b843ed3cfff5ef86218f1572ac398/sidegears-0.1.4.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "536c52985d77268cb7dcab5c2ed296a2", "sha256": "693f4eafb31b1bca44fa63297415e2809529e31b46539fcbda26922f25cb1cc3" }, "downloads": -1, "filename": "sidegears-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "536c52985d77268cb7dcab5c2ed296a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15995, "upload_time": "2019-08-28T02:17:46", "url": "https://files.pythonhosted.org/packages/0c/ce/0d4b7dd62f9a52df2fb641698564c4f236c639d1f4c700bc2218ffd47aa2/sidegears-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed9ceb9e65158bb70d812469ca276070", "sha256": "923ba66903131acf659d7377bfa50f5915a4c698efef51b28165eb4543825863" }, "downloads": -1, "filename": "sidegears-0.1.6.tar.gz", "has_sig": false, "md5_digest": "ed9ceb9e65158bb70d812469ca276070", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14145, "upload_time": "2019-08-20T01:44:55", "url": "https://files.pythonhosted.org/packages/d4/6d/2c25cd0245e10f87c5317939c3e525efc520a951e55492993efbb438ba3d/sidegears-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "536c52985d77268cb7dcab5c2ed296a2", "sha256": "693f4eafb31b1bca44fa63297415e2809529e31b46539fcbda26922f25cb1cc3" }, "downloads": -1, "filename": "sidegears-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "536c52985d77268cb7dcab5c2ed296a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15995, "upload_time": "2019-08-28T02:17:46", "url": "https://files.pythonhosted.org/packages/0c/ce/0d4b7dd62f9a52df2fb641698564c4f236c639d1f4c700bc2218ffd47aa2/sidegears-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ed9ceb9e65158bb70d812469ca276070", "sha256": "923ba66903131acf659d7377bfa50f5915a4c698efef51b28165eb4543825863" }, "downloads": -1, "filename": "sidegears-0.1.6.tar.gz", "has_sig": false, "md5_digest": "ed9ceb9e65158bb70d812469ca276070", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14145, "upload_time": "2019-08-20T01:44:55", "url": "https://files.pythonhosted.org/packages/d4/6d/2c25cd0245e10f87c5317939c3e525efc520a951e55492993efbb438ba3d/sidegears-0.1.6.tar.gz" } ] }