{ "info": { "author": "tryexceptpass", "author_email": "cmedina@tryexceptpass.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: AsyncIO", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Multimedia", "Topic :: Multimedia :: Graphics", "Topic :: Software Development :: User Interfaces" ], "description": "[![Build Status](https://travis-ci.org/tryexceptpass/sofi.svg?branch=master)](https://travis-ci.org/tryexceptpass/sofi) [![Stories in Ready](https://badge.waffle.io/tryexceptpass/sofi.png?label=ready&title=Tasks%20Ready)](https://waffle.io/tryexceptpass/sofi) [![Join the chat at https://gitter.im/try-except-pass/sofi](https://badges.gitter.im/try-except-pass/sofi.svg)](https://gitter.im/try-except-pass/sofi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Documentation Status](https://readthedocs.org/projects/sofi-gui-framework/badge/?version=latest)](http://sofi-gui-framework.readthedocs.io/en/latest/?badge=latest)\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/tryexceptpass)\n\n## Overview\n`sofi` is an OS agnostic UI module for Python.\n\nThe main idea is to allow rapid, pythonic GUI development using standard web-based widgets from `Bootstrap` and\nother common HTML5 libraries and package them in such a way that all event processing is done within python using\n`websockets`.\n\nThis was developed as an exercise in poking at the underlying technologies and to see what comes out of merging them together. For a better overview of why it came to be, feel free to take a look at this post: [A Python Ate My GUI - Part 3: Implementation](http://tryexceptpass.org/article/a-python-ate-my-gui-3)\n\nWe're in a **beta** stage for now, feedback appreciated.\n\n## Usage\nThe `sofi.app.Sofi` object runs the main event thread with `.start()` and provides a number of functions to help manipulate the state of the user interface, which is actually a webpage opened in a browser. The `register` and `unregister` methods provide the mechanism for subscribing to events through callbacks, while the remaining functions (`append`, `replace`, `style`, etc.) wrap the commands intended to dynamically update the widgets (which are actual HTML elements).\n\nThe commands map directly to `D3` or `jQuery` methods present in the `sofi.js` library that's loaded during initialization and is responsible for performing the requested operations.\n\nFollowing basic practices from bootstrap, the widgets should be within a `Container`. The base page itself is represented with the `View` class, which wraps the necessary head, body and style tags that will contain the widgets.\n\nBelow is a quick idea of how to get things going, but check out `sample.py` for a more complicated hello world which instantiates a navbar item, adds a few links, creates some buttons, registers events and performs some timed updates.\n\n\n```python\nfrom sofi.app import Sofi\nfrom sofi.ui import Container, Paragraph, Heading, View\n\nimport json\nimport asyncio\n\n\nasync def onload(event):\n # Every page is built on top of a View object, which contains the and tags that are filled in by the other objects\n v = View()\n\n # Make a bootstrap container in which to put all your widgets\n c = Container()\n\n # Add a heading and paragraph to the container\n c.addelement(Heading(2, \"Dude!\"))\n c.addelement(Paragraph(\"Where's My Car?\"))\n\n # Add the container to the view\n v.addelement(c)\n\n # Tell the UI to load the HTML generated by the view\n app.load(str(v))\n\n\n# Instantiate the application\napp = Sofi()\n\n# Register the event handler that runs when the UI is ready to receive commands\napp.register('init', onload)\n\n# Start the app (opens the default browser) and listen for events\napp.start()\n```\n\n## What do the widgets look like?\n\n![sample.py](https://cdn-images-1.medium.com/max/800/1*euug6f885sjtRPOMt_Vc6g.png)\n\n![timeline.py](https://cdn-images-1.medium.com/max/800/1*AmbFclbXWFdIRYbpa0cyBw.png)", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tryexceptpass/sofi", "keywords": "websockets javascript bootstrap gui unity3d desktop html", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sofi", "package_url": "https://pypi.org/project/sofi/", "platform": "", "project_url": "https://pypi.org/project/sofi/", "project_urls": { "Documentation": "http://sofi-gui-framework.readthedocs.io/en/latest/", "Gitter Chat": "https://gitter.im/try-except-pass/sofi", "Homepage": "https://github.com/tryexceptpass/sofi", "Say Thanks!": "https://saythanks.io/to/tryexceptpass", "Source": "https://github.com/tryexceptpass/sofi" }, "release_url": "https://pypi.org/project/sofi/0.3.9/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Desktop and Web GUI framework based on WebSockets", "version": "0.3.9" }, "last_serial": 3873930, "releases": { "0.3.7": [ { "comment_text": "", "digests": { "md5": "2936935f0612127f6854b038cbd1cf81", "sha256": "94b5e0f7afc6f58aa1cca9b4e0a9e6a923532519a6217894ae1a47a281be2276" }, "downloads": -1, "filename": "sofi-0.3.7.tar.gz", "has_sig": false, "md5_digest": "2936935f0612127f6854b038cbd1cf81", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 22099, "upload_time": "2018-04-22T16:04:40", "url": "https://files.pythonhosted.org/packages/10/14/95765d692e0f1f1e346d08103ff3d143b4a5160fbc9bb37bcef894ba2318/sofi-0.3.7.tar.gz" } ], "0.3.8": [ { "comment_text": "", "digests": { "md5": "53f84b584a5d2d8eec32cd14d8bb720b", "sha256": "cccb9d30d949d0d8c2c94618f241a2e90e77c684737f22044cf3970786eb5928" }, "downloads": -1, "filename": "sofi-0.3.8.tar.gz", "has_sig": false, "md5_digest": "53f84b584a5d2d8eec32cd14d8bb720b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 22107, "upload_time": "2018-04-30T22:11:16", "url": "https://files.pythonhosted.org/packages/ca/fe/889f852d08d86267a2d9ba1d3f454cf0ec909a4a5bad07c519e5f53d610c/sofi-0.3.8.tar.gz" } ], "0.3.9": [ { "comment_text": "", "digests": { "md5": "83dc4fc44c1e91ac0132d87ed829ffb2", "sha256": "60286bf0fdd9de2f390dcaaaaf495213c5ac671087d09e1f5740e2c4d37c7fa3" }, "downloads": -1, "filename": "sofi-0.3.9.tar.gz", "has_sig": false, "md5_digest": "83dc4fc44c1e91ac0132d87ed829ffb2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 22491, "upload_time": "2018-05-17T21:38:58", "url": "https://files.pythonhosted.org/packages/bb/99/37684ad1731b12310b12785b61072d90723eeaa4d24628be178c5efba033/sofi-0.3.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "83dc4fc44c1e91ac0132d87ed829ffb2", "sha256": "60286bf0fdd9de2f390dcaaaaf495213c5ac671087d09e1f5740e2c4d37c7fa3" }, "downloads": -1, "filename": "sofi-0.3.9.tar.gz", "has_sig": false, "md5_digest": "83dc4fc44c1e91ac0132d87ed829ffb2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 22491, "upload_time": "2018-05-17T21:38:58", "url": "https://files.pythonhosted.org/packages/bb/99/37684ad1731b12310b12785b61072d90723eeaa4d24628be178c5efba033/sofi-0.3.9.tar.gz" } ] }