A modern, state-of-the-art Python GUI framework
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
htag2
Here is a full rewrite of htag, using only antigravity and prompts/intentions.
It feels very good. Currently, it's not a replacement, it's just a POC.
It's completely crazy, but it works :
- For building desktop apps (ChromeApp on linux/windows)
- For building web apps (WebApp as an asgi app (for starlette/fastapi/...))
- For building SPA HTML Page (with the PyScript runner)
For building android apps(not yet)
Get Started
Check the Official Documentation for more information.
Install
uv add htag2
Or using pip:
pip install htag2
Alternatively, you can run from source:
git clone https://github.com/manatlan/htag2.git
cd htag2
uv run main3.py
Skill
With gemini-cli, claude-code, mistral-vibe (or others), you can use this SKILL.md to create a htag2 application.
Antigravity resumes :
htag2 is a Python library for building web applications using HTML, CSS, and JavaScript.
Key Resiliency Features Added
- Zero-Config Hot-Reload: Passing
reload=Trueto any runner (e.g.ChromeApp(App).run(reload=True)) automatically watches for Python file changes, seamlessly restarts the backend, and gracefully refreshes the frontend without losing your browser window session. - F5/Reload Robustness: Refreshing the browser no longer kills the Python backend; the session reconstructs cleanly.
- HTTP Fallback (SSE + POST): If WebSockets are blocked (e.g. strict proxies) or fail to connect, the client seamlessly falls back to HTTP POST for events and Server-Sent Events (SSE) for receiving UI updates.
- Production Debug Mode: Easily disable error reporting in the client by setting
debug=Falseon the runner (e.g.WebApp(App, debug=False).app), preventing internal stacktraces from leaking to users. - Parano Mode (Payload Obfuscation): By initializing
WebApp(App, parano=True), all data exchanged between the frontend and backend is automatically obfuscated using a dynamic XOR cipher and Base64 wrapping, making network traffic unreadable to MITM proxies.
New API Features
.root,.parent, and.childsproperties: EveryGTagexposes its position in the component tree..rootreferences the mainTaginstance,.parentreferences the direct parent component, and.childsis a list of its children. This allows components to easily navigate the DOM tree and trigger app-level actions.- Declarative UI with Context Managers (
with): You can now build component trees visually usingwithblocks (e.g.,with Tag.div(): Tag.h1("Hello")), removing the need forself <= ...boilerplate. - Reactive State Management (
State): IntroducingState(value)for automatic UI reactivity. Simply assign aStateto a component using a lambda (e.g.Tag.div(lambda: state.value)), and the UI will auto-update whenever the state changes. Usestate.set(new_value)for functional updates inside callbacks. - Reactive & Boolean Attributes: Attributes like
_class,_style, or_disablednow support lambdas for dynamic updates. Boolean attributes (e.g._disabled=True) are correctly rendered as key-only or omitted. - Rapid Content Replacement (
.text): Use the.textproperty on any tag to quickly replace its inner text content without needing to manually clear its children first. - Recursive Statics & JS: Components created dynamically (via lambdas) now have their
statics(CSS) andcall_jscommands correctly collected and sent to the client. - Scoped Styles (
styles): Define astylesclass attribute on any component to get automatically scoped CSS. The framework prefixes every rule with.htag-ClassName, handles@media,@keyframes, pseudo-selectors, and multi-selectors. - CSS Class Helpers:
add_class(),remove_class(),toggle_class(), andhas_class()for convenient class manipulation without manual string handling. State.notify(): Manually trigger reactive updates after in-place mutations of mutable values (lists, dicts).- Simple Events & HashChange: Support for passing primitive values or custom objects from JS. Includes built-in support for
_onhashchangewithnewURLandoldURLattributes.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file htag2-0.1.4.tar.gz.
File metadata
- Download URL: htag2-0.1.4.tar.gz
- Upload date:
- Size: 61.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
984caa70c53a6156888c06c9331b37d183fd5905fa2b992bd1e93378ba53182d
|
|
| MD5 |
d5deb41723d75ac223500d231330ee7f
|
|
| BLAKE2b-256 |
04c95b39c0f11c89b9f00e7de86195b41cf5105f0b44d92809e30275d1ed59bf
|
Provenance
The following attestation bundles were made for htag2-0.1.4.tar.gz:
Publisher:
release.yml on manatlan/htag2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
htag2-0.1.4.tar.gz -
Subject digest:
984caa70c53a6156888c06c9331b37d183fd5905fa2b992bd1e93378ba53182d - Sigstore transparency entry: 1042956296
- Sigstore integration time:
-
Permalink:
manatlan/htag2@6a0838988dc9bd2f2028a502768a858da6c4ff89 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/manatlan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a0838988dc9bd2f2028a502768a858da6c4ff89 -
Trigger Event:
push
-
Statement type:
File details
Details for the file htag2-0.1.4-py3-none-any.whl.
File metadata
- Download URL: htag2-0.1.4-py3-none-any.whl
- Upload date:
- Size: 46.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74391afb874c2488dddb48013cc83ac986f0020c2021b929662348c2d0610e3d
|
|
| MD5 |
21eb045f682d6e10679af0cb6ddb0e83
|
|
| BLAKE2b-256 |
59d07b5a765477942230f3500339970389baa565f867703931c1f2736b05f669
|
Provenance
The following attestation bundles were made for htag2-0.1.4-py3-none-any.whl:
Publisher:
release.yml on manatlan/htag2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
htag2-0.1.4-py3-none-any.whl -
Subject digest:
74391afb874c2488dddb48013cc83ac986f0020c2021b929662348c2d0610e3d - Sigstore transparency entry: 1042956299
- Sigstore integration time:
-
Permalink:
manatlan/htag2@6a0838988dc9bd2f2028a502768a858da6c4ff89 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/manatlan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a0838988dc9bd2f2028a502768a858da6c4ff89 -
Trigger Event:
push
-
Statement type: