htag


Namehtag JSON
Version 0.103.0 PyPI version JSON
download
home_pagehttps://github.com/manatlan/htag
SummaryGUI toolkit for building GUI toolkits (and create beautiful applications for mobile, web, and desktop from a single python3 codebase)
upload_time2024-04-13 06:05:28
maintainerNone
docs_urlNone
authormanatlan
requires_python<4.0,>=3.7
licenseMIT
keywords gui electron cef pywebview starlette uvicorn tornado asyncio desktop web mobile http websocket html pyscript android kivy apk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HTag : "H(tml)Tag"

<img src="https://manatlan.github.io/htag/htag.png" width="100" height="100">

[![Test](https://github.com/manatlan/htag/actions/workflows/on_commit_do_all_unittests.yml/badge.svg)](https://github.com/manatlan/htag/actions/workflows/on_commit_do_all_unittests.yml)

<a href="https://pypi.org/project/htag/">
    <img src="https://badge.fury.io/py/htag.svg?x" alt="Package version">
</a>


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](https://manatlan.github.io/htag/runners/) !
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](https://manatlan.github.io/htag/runner), which will run the UI in a local chrome in "app mode" (headless).
    * You can use the [PyWebView runner](https://manatlan.github.io/htag/runners/#pywebwiew), which will run the UI in a pywebview container 
 * For a **android app** : See [htagapk](https://github.com/manatlan/htagapk)
 * For a **web app** : You can use the [htagweb](https://github.com/manatlan/htagweb).
 * For a **html app** (think SPA (run in an html context (no python!))):
    * you can use the [PyScript runner](https://manatlan.github.io/htag/runners/#runner-pyscript), which will run completly in client side
    * you can use the [htag for brython](https://github.com/manatlan/htag/blob/main/brython/README.md), which will run completly in client side


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](https://manatlan.github.io/htag/)

[DEMO/TUTORIAL](https://htag.glitch.me/)

[Changelog](https://github.com/manatlan/htag/releases)

[Available on pypi.org](https://pypi.org/project/htag/)

[Announcement on reddit (22/07/14)](https://www.reddit.com/r/Python/comments/vysnci/htag_a_new_gui_tookit_for_webdesktopandroid_from/)


Well tested:
 - Pytests on core at 99%
 - Real [Selenium TESTS in github CI/CD](https://github.com/manatlan/htag/actions/workflows/selenium.yaml) **every days**

## To have a look

 * [htag.glitch.me](https://htag.glitch.me/): A htag app, hosted on glitch.com, running with [htagweb](https://github.com/manatlan/htagweb). Many examples from simpler to complex ones, in tutorial spirit.
 * [pyscript/demo](https://raw.githack.com/manatlan/htag/main/examples/pyscript_demo.html): A htag app in a simple html page, running with [pyscript runner](https://manatlan.github.io/htag/runners/#pyscript). Many examples in a REPL mode (you can try/edit/run them). (ONLY HTML needed)

## ROADMAP to 1.0.0

 * tests tests
 * 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](https://manatlan.github.io/htag/runner) ! So compatibility shouldn't be breaked with htag <0.90 ! But they will be removed in 1.0.
 * polish the new Runner [Runner](https://manatlan.github.io/htag/runner) and docs !
 * ~~setup minimal docs, with [that](https://realpython.com/python-project-documentation-with-mkdocs/) ;-)~~
 * ~~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](https://github.com/manatlan/guy), which was/is the same concept as [python-eel](https://github.com/ChrisKnott/Eel), but more advanced.
One day, I've discovered [remi](https://github.com/rawpython/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](https://github.com/manatlan/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](https://github.com/manatlan/htag) was born. The codebase is very short, concepts are better implemented, and it's very easy to maintain.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/manatlan/htag",
    "name": "htag",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.7",
    "maintainer_email": null,
    "keywords": "gui, electron, cef, pywebview, starlette, uvicorn, tornado, asyncio, desktop, web, mobile, http, websocket, html, pyscript, android, kivy, apk",
    "author": "manatlan",
    "author_email": "manatlan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b0/55/7720a505f7d7aabe4e815c66f337cd172a399da673610f7efbca0fdf26c1/htag-0.103.0.tar.gz",
    "platform": null,
    "description": "# HTag : \"H(tml)Tag\"\n\n<img src=\"https://manatlan.github.io/htag/htag.png\" width=\"100\" height=\"100\">\n\n[![Test](https://github.com/manatlan/htag/actions/workflows/on_commit_do_all_unittests.yml/badge.svg)](https://github.com/manatlan/htag/actions/workflows/on_commit_do_all_unittests.yml)\n\n<a href=\"https://pypi.org/project/htag/\">\n    <img src=\"https://badge.fury.io/py/htag.svg?x\" alt=\"Package version\">\n</a>\n\n\nA new python library to create UI (or UI toolkit), which render nativly in anything which can render **html/js/css**.\nThoses can be a browser, a pywebview, an android/apk, or anything based on cef, depending on an [htag runner](https://manatlan.github.io/htag/runners/)\u00a0!\nAs it's based on html/js rendering: you can easily mix powerful JS libs with powerful PY3 libs : and make powerful python apps !\n\n * For a **desktop app** : \n    * You can use the [Runner](https://manatlan.github.io/htag/runner), which will run the UI in a local chrome in \"app mode\" (headless).\n    * You can use the [PyWebView runner](https://manatlan.github.io/htag/runners/#pywebwiew), which will run the UI in a pywebview container \n * For a **android app** : See [htagapk](https://github.com/manatlan/htagapk)\n * For a **web app** : You can use the [htagweb](https://github.com/manatlan/htagweb).\n * For a **html app** (think SPA (run in an html context (no python!))):\n    * you can use the [PyScript runner](https://manatlan.github.io/htag/runners/#runner-pyscript), which will run completly in client side\n    * you can use the [htag for brython](https://github.com/manatlan/htag/blob/main/brython/README.md), which will run completly in client side\n\n\nBut yes \u2026 the promise is here : **it's a GUI toolkit for building \"beautiful\" applications for mobile, web, and desktop from a single codebase**.\n\n[DOCUMENTATION](https://manatlan.github.io/htag/)\n\n[DEMO/TUTORIAL](https://htag.glitch.me/)\n\n[Changelog](https://github.com/manatlan/htag/releases)\n\n[Available on pypi.org](https://pypi.org/project/htag/)\n\n[Announcement on reddit (22/07/14)](https://www.reddit.com/r/Python/comments/vysnci/htag_a_new_gui_tookit_for_webdesktopandroid_from/)\n\n\nWell tested:\n - Pytests on core at 99%\n - Real [Selenium TESTS in github CI/CD](https://github.com/manatlan/htag/actions/workflows/selenium.yaml) **every days**\n\n## To have a look\n\n * [htag.glitch.me](https://htag.glitch.me/): A htag app, hosted on glitch.com, running with [htagweb](https://github.com/manatlan/htagweb). Many examples from simpler to complex ones, in tutorial spirit.\n * [pyscript/demo](https://raw.githack.com/manatlan/htag/main/examples/pyscript_demo.html): A htag app in a simple html page, running with [pyscript runner](https://manatlan.github.io/htag/runners/#pyscript). Many examples in a REPL mode (you can try/edit/run them). (ONLY HTML needed)\n\n## ROADMAP to 1.0.0\n\n * tests tests\n * 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)\n * 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](https://manatlan.github.io/htag/runner) ! So compatibility shouldn't be breaked with htag <0.90 ! But they will be removed in 1.0.\n * polish the new Runner [Runner](https://manatlan.github.io/htag/runner) and docs !\n * ~~setup minimal docs, with [that](https://realpython.com/python-project-documentation-with-mkdocs/) ;-)~~\n * ~~top level api could change (Tag() -> create a Tag, Tag.mytag() -> create a TagBase ... can be a little bit ambiguous)~~\n * ~~manage \"query params\" from url to initialize Tags/routes~~\n * ~~I don't really like the current way to generate js in interaction : need to found something more solid.~~\n * ~~the current way to initiate the statics is odd (only on real (embedded) Tag's) : should find a better way (static like gtag ?!)~~\n\nand more technicals :\n- ~~better js try/catch to sort js/py error + try/catch on http com error (for thoses which kill session webhttp/pye) ~~\n- ~~getStateImage is non sense coz it's str'ing (why not returning the str ?!)~~\n- ~~mix the Tag.__init__ with the old system (like this: it's unmaintable)~~\n- ~~introduce a virtual tag/placeholder~~\n- 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\n\n- ~~rename \"tag\" to \"self\" for js statements (keep the twos, for compatibility reasons)~~\n- ~~Make it possibles -> NOT POSSIBLE currently ... abandonned ;-)~~\n    ~~self.js = self.bind( self.starting , b'window.innerWidth') # doesn't work currently~~\n    ~~self.js = self.bind.starting( b'window.innerWidth' ) # work (only reason to keep the \"old form\")~~\n\n- ~~perhaps `self( js_statement)` -> `self.call( js_statement )` ... less confusing !~~\n- ~~thus, to avoid `self( self.bind.method(*a,**k) )`, you can write `self.call.<method>( *a,**k )`~~\n\n\n\n## History\n\nAt the beginning, there was [guy](https://github.com/manatlan/guy), which was/is the same concept as [python-eel](https://github.com/ChrisKnott/Eel), but more advanced.\nOne day, I've discovered [remi](https://github.com/rawpython/remi), and asked my self, if it could be done in a *guy way*. The POC was very good, so I released\na version of it, named [gtag](https://github.com/manatlan/gtag). It worked well despite some drawbacks, but was too difficult to maintain. So I decided to rewrite all\nfrom scratch, while staying away from *guy* (to separate, *rendering* and *runners*)... and [htag](https://github.com/manatlan/htag) was born. The codebase is very short, concepts are better implemented, and it's very easy to maintain.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "GUI toolkit for building GUI toolkits (and create beautiful applications for mobile, web, and desktop from a single python3 codebase)",
    "version": "0.103.0",
    "project_urls": {
        "Documentation": "https://manatlan.github.io/htag/",
        "Homepage": "https://github.com/manatlan/htag",
        "Repository": "https://github.com/manatlan/htag"
    },
    "split_keywords": [
        "gui",
        " electron",
        " cef",
        " pywebview",
        " starlette",
        " uvicorn",
        " tornado",
        " asyncio",
        " desktop",
        " web",
        " mobile",
        " http",
        " websocket",
        " html",
        " pyscript",
        " android",
        " kivy",
        " apk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "881a09ac06743c59168f4c2954ec387d05a095b57c8d24e7f7615adba9fcc59a",
                "md5": "5bd0a66a7caf51cabe09863bb55d00f3",
                "sha256": "bcee006565c5bc85a8e8ba271c21d3706a508fe20ac10b6fe5d3e577dddb3f55"
            },
            "downloads": -1,
            "filename": "htag-0.103.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5bd0a66a7caf51cabe09863bb55d00f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.7",
            "size": 36185,
            "upload_time": "2024-04-13T06:05:24",
            "upload_time_iso_8601": "2024-04-13T06:05:24.075465Z",
            "url": "https://files.pythonhosted.org/packages/88/1a/09ac06743c59168f4c2954ec387d05a095b57c8d24e7f7615adba9fcc59a/htag-0.103.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0557720a505f7d7aabe4e815c66f337cd172a399da673610f7efbca0fdf26c1",
                "md5": "cec1aa88274f1d99b53d348666109ee3",
                "sha256": "fd970511574d492ccc95319162f30723116c8acff4cebdc831e5bc7534161c89"
            },
            "downloads": -1,
            "filename": "htag-0.103.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cec1aa88274f1d99b53d348666109ee3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.7",
            "size": 33179,
            "upload_time": "2024-04-13T06:05:28",
            "upload_time_iso_8601": "2024-04-13T06:05:28.696262Z",
            "url": "https://files.pythonhosted.org/packages/b0/55/7720a505f7d7aabe4e815c66f337cd172a399da673610f7efbca0fdf26c1/htag-0.103.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-13 06:05:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "manatlan",
    "github_project": "htag",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "htag"
}
        
Elapsed time: 0.24601s