Skip to main content

Brython-Radiant

A Brython Framework for Web Apps development.

GitHub top language PyPI - License PyPI PyPI - Status PyPI - Python Version GitHub last commit CodeFactor Grade Documentation Status

Radiant is a Brython framework for the quick development of web apps with pure Python/Brython syntax so there is no need to care about (if you don’t want) HTML, CSS, or Javascript. Run over Tornado servers and include support to Websockets, Python Scripts and MDC.

Instalation

pip install radiant

Usage

Bare minimum

# Radiant modules
from radiant.server import RadiantAPI

# Brython modules
from browser import document, html  # This modules are faked after `radiant` inport

# 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
        #-----------------------------------------------------------

# Run server
if __name__ == '__main__':
    BareMinimum()

Extra options

# Radiant modules
from radiant.server import RadiantAPI, RadiantServer  # import RadiantServer for advanced options

from browser import document, html

# Main class inheriting RadiantAPI
class BareMinimum(RadiantAPI):

    def __init__(self, *args, **kwargs):
        """"""
        super().__init__(*args, **kwargs)

        #-----------------------------------------------------------
        # Brython code
        document.select_one('body') <= html.H1('Hello World')
        #
        # ...all your brython code
        #-----------------------------------------------------------
        
if __name__ == '__main__':
    # Advance options
    RadiantServer('BareMinimum',
                  host='localhost',
                  port=5000,
                  brython_version='3.9.1',
                  debug_level=0,
                  )

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, and a custom HTML template is configured in runtime to import the same script, this time under Brython, is very simple.

Metadata

Release files for radiant 3.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for radiant 3.3.9
File Size Uploaded
radiant-3.3.9.tar.gz 19.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for radiant 3.3.9
File Interpreter ABI Platform
radiant-3.3.9-py3-none-any.whl Python 3 none any Details

Total release size: 47.9 MB

Release files / radiant-3.3.9.tar.gz

Download URL radiant-3.3.9.tar.gz
Size 19.0 MB
Tags Source
SHA-256 checksum
How to use checksums
47877a30ae539641a44fcda0a15ce1b8ce8fbd91c2fb1696e374b5e2028122ee
BLAKE2b-256 checksum
How to use checksums
3efc3de919c2e50d852e98cc13e0976fa9f21aba0a1332e2a58c11f137963d75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / radiant-3.3.9-py3-none-any.whl

Download URL radiant-3.3.9-py3-none-any.whl
Size 28.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fb3c860ba5022415fc057a9aab342977c7da3a429f61c2d008d4bdab771204f1
BLAKE2b-256 checksum
How to use checksums
3cb9508e34f0bcb6a8ef74b526f89277163a79b10aff3b564c2546c40f8c5428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

3.3.9 This release

2 release files

3.3.8

2 release files

3.3.7

2 release files

3.3.6

2 release files

3.3.5

2 release files

3.3.4

2 release files

3.3.3

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2

2 release files

3.1

2 release files

3.0

2 release files

2.4

1 release file

2.3

1 release file

2.2

1 release file

2.1

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page