Metadata-Version: 2.4
Name: counterweight
Version: 0.1.0
Summary: An experimental TUI framework for Python, inspired by React and Tailwind
Keywords: tui,terminal
Author: JoshKarpel
Author-email: JoshKarpel <josh.karpel@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Operating System :: MacOS
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Artistic Software
Classifier: Topic :: Multimedia :: Graphics :: Presentation
Classifier: Typing :: Typed
Requires-Dist: more-itertools>=9.1
Requires-Dist: waxy>=0.7.1
Requires-Dist: without-cli>=0.0.10
Requires-Dist: without-logging>=0.0.10
Requires-Dist: without-streams>=0.0.10
Requires-Dist: wcwidth>=0.8
Requires-Dist: markdown-it-py>=4.1
Requires-Dist: pygments>=2.17
Requires-Dist: mdit-py-plugins>=0.5
Requires-Dist: pyghostty>=0.1.3
Requires-Dist: pillow>=12
Requires-Python: >=3.15
Project-URL: Homepage, https://github.com/JoshKarpel/counterweight
Project-URL: Repository, https://github.com/JoshKarpel/counterweight
Project-URL: Documentation, https://www.counterweight.dev
Project-URL: Bug Tracker, https://github.com/JoshKarpel/counterweight/issues
Description-Content-Type: text/markdown

<h1>
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/JoshKarpel/counterweight/main/docs/assets/logo/wordmark-dark.svg">
    <img alt="Counterweight" src="https://raw.githubusercontent.com/JoshKarpel/counterweight/main/docs/assets/logo/wordmark-light.svg">
  </picture>
</h1>

[![PyPI](https://img.shields.io/pypi/v/counterweight)](https://pypi.org/project/counterweight)
[![PyPI - License](https://img.shields.io/pypi/l/counterweight)](https://pypi.org/project/counterweight)
[![Docs](https://img.shields.io/badge/docs-exist-brightgreen)](https://www.counterweight.dev)

[![quality-check](https://github.com/JoshKarpel/counterweight/actions/workflows/quality-check.yml/badge.svg)](https://github.com/JoshKarpel/counterweight/actions/workflows/quality-check.yml)

[![GitHub issues](https://img.shields.io/github/issues/JoshKarpel/counterweight)](https://github.com/JoshKarpel/counterweight/issues)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/JoshKarpel/counterweight)](https://github.com/JoshKarpel/counterweight/pulls)

Counterweight is an experimental text user interface (TUI) framework for Python,
inspired by [React](https://react.dev/) and [Tailwind CSS](https://tailwindcss.com/).

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](https://pypi.org/project/counterweight/):

```bash
pip install counterweight
```
