Counterweight
Counterweight is an experimental text user interface (TUI) framework for Python, inspired by React and Tailwind CSS.
A TUI application built with Counterweight is a tree of declarative components, each of which represents some piece of the UI by bundling together a visual element along with its state and how that state should change due to events like user input.
As an application author, you define the components and their relationships as a tree of Python functions. You use hooks to manage state and side effects, and styles to change how the elements look.
Counterweight takes this declarative representation of the UI and renders it to the terminal, updating the UI when state changes in response to user input or side effects (by calling your function tree).
Installation
Counterweight is available on PyPI:
pip install counterweight
Release files for counterweight 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| counterweight-0.0.9.tar.gz | 46.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| counterweight-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.5 kB
Release files / counterweight-0.0.9.tar.gz
| Download URL | counterweight-0.0.9.tar.gz |
|---|---|
| Size | 46.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
569c6c846a91940e390401db17be8ff9ca882a6d772d88c8f9f552f6091cf133
|
|
BLAKE2b-256 checksum How to use checksums |
2be1a311f5f32c8e4834a7ea4c6561eca3001e11162054b41c4486dac79d5acf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / counterweight-0.0.9-py3-none-any.whl
| Download URL | counterweight-0.0.9-py3-none-any.whl |
|---|---|
| Size | 54.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44f242ec7e673cd007fbe5794957d8efc007e7df56e01cd1928d2d3fde38a47a
|
|
BLAKE2b-256 checksum How to use checksums |
f5afa6cd36b180c63a3742b602acead2dcba58ad3ab38418be4b64deb85e526e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|