All Projects → tryexceptpass → Sofi

tryexceptpass / Sofi

Licence: mit
an OS agnostic UI module for Python

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Sofi

Iced
A cross-platform GUI library for Rust, inspired by Elm
Stars: ✭ 12,176 (+3121.16%)
Mutual labels:  gui, widget
Neogfx
Cross-platform GPU-oriented C++ application/game framework
Stars: ✭ 362 (-4.23%)
Mutual labels:  gui, widget
Tabtoolbar
A small library for creating tabbed toolbars
Stars: ✭ 129 (-65.87%)
Mutual labels:  gui, widget
Pyrustic
Lightweight framework and software suite to help develop, package, and publish Python desktop applications
Stars: ✭ 75 (-80.16%)
Mutual labels:  gui, widget
Clrcli
CLRCLI is an event-driven library for building line-art user interfaces in C#/.Net command-line applications.
Stars: ✭ 124 (-67.2%)
Mutual labels:  gui, widget
Fltkhs
Haskell bindings to FLTK GUI toolkit.
Stars: ✭ 187 (-50.53%)
Mutual labels:  gui, widget
Slip
Slip.js — UI library for manipulating lists via swipe and drag gestures
Stars: ✭ 2,421 (+540.48%)
Mutual labels:  gui, widget
Ricochet
Anonymous peer-to-peer instant messaging
Stars: ✭ 3,570 (+844.44%)
Mutual labels:  gui
Sqlectron Gui
A simple and lightweight SQL client desktop with cross database and platform support.
Stars: ✭ 3,852 (+919.05%)
Mutual labels:  gui
Jqview
simplest possible native GUI for inspecting JSON objects with jq
Stars: ✭ 355 (-6.08%)
Mutual labels:  gui
Kondo
Save disk space by cleaning non-essential files from software projects.
Stars: ✭ 373 (-1.32%)
Mutual labels:  gui
Unity Winforms
A Windows Forms port for Unity3d
Stars: ✭ 365 (-3.44%)
Mutual labels:  gui
Myra
UI Library for MonoGame, FNA and Stride
Stars: ✭ 348 (-7.94%)
Mutual labels:  gui
Flutter radial menu
A simple animated radial menu widget for Flutter.
Stars: ✭ 359 (-5.03%)
Mutual labels:  widget
Threepenny Gui
GUI framework that uses the web browser as a display.
Stars: ✭ 368 (-2.65%)
Mutual labels:  gui
Controlp5
A gui library for processing.org
Stars: ✭ 356 (-5.82%)
Mutual labels:  gui
Interactive slam
Interactive Map Correction for 3D Graph SLAM
Stars: ✭ 372 (-1.59%)
Mutual labels:  gui
Pickr
🎨 Flat, simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!
Stars: ✭ 3,759 (+894.44%)
Mutual labels:  widget
Wxwidgets
wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls.
Stars: ✭ 3,994 (+956.61%)
Mutual labels:  gui
Lazykube
⎈ The lazier way to manage kubernetes.
Stars: ✭ 369 (-2.38%)
Mutual labels:  gui

Build Status Stories in Ready Join the chat at https://gitter.im/try-except-pass/sofi Documentation Status Say Thanks!

Overview

sofi is an OS agnostic UI module for Python.

The main idea is to allow rapid, pythonic GUI development using standard web-based widgets from Bootstrap and other common HTML5 libraries and package them in such a way that all event processing is done within python using websockets.

This 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

We're in a beta stage for now, feedback appreciated.

Usage

The 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).

The 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.

Following 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.

Below 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.

from sofi.app import Sofi
from sofi.ui import Container, Paragraph, Heading, View

import json
import asyncio


async def onload(event):
    # Every page is built on top of a View object, which contains the <head> and <body> tags that are filled in by the other objects
    v = View()

    # Make a bootstrap container in which to put all your widgets
    c = Container()

    # Add a heading and paragraph to the container
    c.addelement(Heading(2, "Dude!"))
    c.addelement(Paragraph("Where's My Car?"))

    # Add the container to the view
    v.addelement(c)

    # Tell the UI to load the HTML generated by the view
    app.load(str(v))


# Instantiate the application
app = Sofi()

# Register the event handler that runs when the UI is ready to receive commands
app.register('init', onload)

# Start the app (opens the default browser) and listen for events
app.start()

What do the widgets look like?

sample.py

timeline.py

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].