Skip to main content

An experimental TUI framework for Python, inspired by React and Tailwind

Project description

PyPI PyPI - License Docs

pre-commit.ci status codecov

GitHub issues GitHub pull requests

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

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

counterweight-0.0.4.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

counterweight-0.0.4-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file counterweight-0.0.4.tar.gz.

File metadata

  • Download URL: counterweight-0.0.4.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for counterweight-0.0.4.tar.gz
Algorithm Hash digest
SHA256 5f637d25bbae861eae2195b6ed8b73eb5005818aa5190d8299d2750f45906646
MD5 9e0afe083fc23a133a177d10ffcd2d06
BLAKE2b-256 c073918760e410877bfc55a95799d8b3a6cf02b3f8d0b8cb137a19a847695fc0

See more details on using hashes here.

Provenance

File details

Details for the file counterweight-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for counterweight-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 78ace37987d115d714d87563f5ffbdb6554f2b8e849f1b8f8146e88adfbd06b1
MD5 8c404f76f20e065305d9bdb8763a26d6
BLAKE2b-256 6702cc739586d0b157ac96d447d2b92ecec56ea3f1fecf51a5b717c7a7f9b429

See more details on using hashes here.

Provenance

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