Brython Framework
Project description
Brython-Radiant
A Brython Framework for Web Apps development.
Radiant is a Brython framework for the quick development of web apps from pure Python syntax which means that there is no need to care about (if you don't want) HTML, CSS, or Javascript. It's based on Tornado servers and includes support to Websockets, Python Scripts and MDC.
Instalation
pip install radiant
Usage
# Brython modules
from browser import document, html
# Radiant modules
from radiant.server import RadiantAPI, RadiantServer
# Main class inheriting RadiantAPI
class BareMinimum(RadiantAPI):
# Constructor
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
#-----------------------------------------------------------
# Brython code (finally)
document.select_one('body') <= html.H1('Hello World')
#
# ...all your brython code
#-----------------------------------------------------------
# Execute server
if __name__ == '__main__':
RadiantServer('BareMinimum')
How to works
This is basically a set of scripts that allows the same file run from Python and Brython, when is running under Python a Tornado server is created and configure the local path for serving static files, a custom HTML template is configured in runtime to import the same script, this time under Brython, is very simple.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.