Skip to main content

A framework that enables Python objects to be easily rendered on a web server

Project description

PyX Framework

Introduction

PyX Framework is a framework that enables Python objects to be easily rendered on a web server. This allows Python developers to integrate their backend logic with web interfaces seamlessly.

Features

  • Automatic Rendering: Implement __render__(self, user) in Python objects to display them as web components.
  • Event Handling: Easily handle user interactions with Python methods.
  • Dynamic Updates: Changes in Python object states are automatically reflected in the web interface.

Installation

To install PyX Framework, use pip:

pip install pyx-react

or clone this repository:

git clone https://github.com/cykim8811/pyx-react.git
cd pyx-react
python setup.py install

To install vscode extension, search for pyx-react in vscode extension marketplace.

Usage

Here's a simple example of how to use PyX Framework:

  • Create a .pyx file
from pyx import createElement, App

class Counter:
    def __init__(self):
        self.count = 8

    def increment(self, e):
        if e.button == 0:
            self.count += 1

    def __render__(self, user):
        return (
            <div>
                <div>count: {self.count}</div>
                <button onClick={self.increment}>Increment</button>
            </div>
        )


app = App(Counter())
app.run(host='0.0.0.0', port=8080)
  • Run pyx transpiler
pyx file.pyx
  • Run transpiled .py file
python3 file.x.py

Result

result

Documentation

No documentation is available at the moment. Please refer to the examples for more information.

Contributing

Contributions to PyX Framework are welcome!

License

PyX Framework is licensed under MIT License.

Contact

cykim8811@snu.ac.kr

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyx-react-0.1.4.tar.gz (99.6 kB view details)

Uploaded Source

Built Distribution

pyx_react-0.1.4-py3-none-any.whl (96.3 kB view details)

Uploaded Python 3

File details

Details for the file pyx-react-0.1.4.tar.gz.

File metadata

  • Download URL: pyx-react-0.1.4.tar.gz
  • Upload date:
  • Size: 99.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyx-react-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f195e17831525e09ad95a2e4dd7be02d8484480349119bc9f3618814997c3f1f
MD5 0c0f9a1c8b6252e4cb0f84a182c35662
BLAKE2b-256 d4d7086cf0135f72dcf1e4d5476bea169b5f8de85a285eb2f5393de20ce7ede7

See more details on using hashes here.

File details

Details for the file pyx_react-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pyx_react-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 96.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyx_react-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7edbe7f3c8c1c4a6c79b533b54ab1c44af95abd3280feb96880f37bd50118ec9
MD5 d84b106e60c1b5962a7e1b507437cbab
BLAKE2b-256 6debf03ca7c9198bfd5dc94d6fcf673db051b10837839bbda0c4b94d14c982b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page