Skip to main content

A lightweight, component-based HTML builder

Project description

GenJuice

A lightweight, component-based HTML builder.

from genjuice import Component
from genjuice.components import Button

class FancyButton(Component):
    def render(self):
        return Button("Hello, world!").attr(onclick="alert(1)").render()
>>> FancyButton().render()
"""
<button onclick="alert(1)">Hello, world!</button>
"""

Installation

GenJuice isn't quite ready for production yet. Feel free to mess around with it:

pip install genjuice

Why GenJuice?

  • The core functionality (Component.render()) is less than 30 lines long
  • On average, it's 2.2x faster than its counterparts (HTML builders/template engines such as Jinja)
  • You write your UI code in 100% Python (including CSS!)
  • A modern, intuitive API
  • ...and much more to come!

License

MIT

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

genjuice-0.1.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

genjuice-0.1.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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