Skip to main content

GUI toolkit for building GUI toolkits (and create beautiful applications for mobile, web, and desktop from a single python3 codebase)

Project description

HTag : "H(tml)Tag"

Test

Package version

A new python library to create UI (or UI toolkit), which render nativly in anything which can render html/js/css. Thoses can be a browser, a pywebview, an android/apk, or anything based on cef, depending on an htag runner ! As it's based on html/js rendering: you can easily mix powerful JS libs with powerful PY3 libs : and make powerful python apps !

  • For a desktop app :
    • You can use the Runner, which will run the UI in a local chrome in "app mode" (headless).
    • You can use the PyWebView runner, which will run the UI in a pywebview container
  • For a android app : See htagapk
  • For a web app : You can use the htagweb.
  • For a html app (think SPA (run in an html context (no python!))):

But yes … the promise is here : it's a GUI toolkit for building "beautiful" applications for mobile, web, and desktop from a single codebase.

DOCUMENTATION

DEMO(pyscript)

htagdemo

Changelog

Available on pypi.org

Announcement on reddit (22/07/14)

Well tested:

To have a look

  • htagdemo: A htag app, hosted on render.com, running with htagweb. Many examples from simpler to complex ones, in tutorial spirit. (in construction, so may have bugs)
  • pyscript/demo: A htag app in a simple html page, running with pyscript runner. Many examples in a REPL mode (you can try/edit/run them). (ONLY HTML needed)

ROADMAP to 1.0.0

  • 2025/9/27 ... migrate repo from poetry to the marvelous uv
  • mid-2025 ... I really need to release the 1.0 ;-) (I use the latest a lot, and it's near perfection (at least for me))
  • Some news 12/10/2024 : the 1.0 will come, because I mainly use it: without troubles/new_ideas : it works as expected. Perhaps some refactoring and polish : but features are here. (preparing a htag demo in a docker container)
  • the "0.100.x" version introduce a "new event mechanism" ("ev") : need to find a solution if it will be mandatory for 1.0.0 (don't know yet), to not break my (more than) 200 apps ;-) ... currently both are available (depending of the parameter name)
  • the "0.90.x" version is important, because all previous runners (using starlette/uvicorn/tornado) are gone, and are simulated/faked with a new Runner ! So compatibility shouldn't be breaked with htag <0.90 ! But they will be removed in 1.0.
  • polish the new Runner Runner and docs !
  • setup minimal docs, with that ;-)
  • top level api could change (Tag() -> create a Tag, Tag.mytag() -> create a TagBase ... can be a little bit ambiguous)
  • manage "query params" from url to initialize Tags/routes
  • I don't really like the current way to generate js in interaction : need to found something more solid.
  • the current way to initiate the statics is odd (only on real (embedded) Tag's) : should find a better way (static like gtag ?!)

and more technicals :

  • ~~better js try/catch to sort js/py error + try/catch on http com error (for thoses which kill session webhttp/pye) ~~

  • getStateImage is non sense coz it's str'ing (why not returning the str ?!)

  • mix the Tag.init with the old system (like this: it's unmaintable)

  • introduce a virtual tag/placeholder

  • DISPLAY a warning (or exception in STRICT_MODE), when a render method use a "tag creation" (ex: Tag.div("hello")), because it will always be rendered !!!!! -> bad habits

  • rename "tag" to "self" for js statements (keep the twos, for compatibility reasons)

  • Make it possibles -> NOT POSSIBLE currently ... abandonned ;-) self.js = self.bind( self.starting , b'window.innerWidth') # doesn't work currently self.js = self.bind.starting( b'window.innerWidth' ) # work (only reason to keep the "old form")

  • perhaps self( js_statement) -> self.call( js_statement ) ... less confusing !

  • thus, to avoid self( self.bind.method(*a,**k) ), you can write self.call.<method>( *a,**k )

History

At the beginning, there was guy, which was/is the same concept as python-eel, but more advanced. One day, I've discovered remi, and asked my self, if it could be done in a guy way. The POC was very good, so I released a version of it, named gtag. It worked well despite some drawbacks, but was too difficult to maintain. So I decided to rewrite all from scratch, while staying away from guy (to separate, rendering and runners)... and htag was born. The codebase is very short, concepts are better implemented, and it's very easy to maintain.

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.

Source Distribution

htag-0.202.0.tar.gz (260.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htag-0.202.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file htag-0.202.0.tar.gz.

File metadata

  • Download URL: htag-0.202.0.tar.gz
  • Upload date:
  • Size: 260.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for htag-0.202.0.tar.gz
Algorithm Hash digest
SHA256 ff859cdfd17607abac0768615af9f9656894372df73d9ad6f32381698cd49abb
MD5 8f787becb97218b469a691e0008a9b6c
BLAKE2b-256 573309088e85a89c31e43ec216483aa58f469a92f6dc2a62749239f36e13a3f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for htag-0.202.0.tar.gz:

Publisher: on_tag_do_release_and_deploy_pypi.yml on manatlan/htag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file htag-0.202.0-py3-none-any.whl.

File metadata

  • Download URL: htag-0.202.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for htag-0.202.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8826a302605b1365f4a5444c8d5c622d9c7393eb0ffc408c9e10d2458f5a1e4f
MD5 4565720bd4bac9c4a9d6b1a914ea1ded
BLAKE2b-256 c6ac00f8b1728c48280a1d4329446e97bd80e9e071a03fbc87bc58212fdfe57c

See more details on using hashes here.

Provenance

The following attestation bundles were made for htag-0.202.0-py3-none-any.whl:

Publisher: on_tag_do_release_and_deploy_pypi.yml on manatlan/htag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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