Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JoshKarpel/counterweight
An experimental TUI framework for Python, inspired by React and Tailwind
https://github.com/JoshKarpel/counterweight
python terminal tui
Last synced: 11 days ago
JSON representation
An experimental TUI framework for Python, inspired by React and Tailwind
- Host: GitHub
- URL: https://github.com/JoshKarpel/counterweight
- Owner: JoshKarpel
- License: mit
- Created: 2023-06-08T23:30:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-24T23:55:35.000Z (5 months ago)
- Last Synced: 2024-06-25T16:06:24.249Z (5 months ago)
- Topics: python, terminal, tui
- Language: Python
- Homepage: https://www.counterweight.dev
- Size: 1.29 MB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![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)[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/JoshKarpel/counterweight/main.svg)](https://results.pre-commit.ci/latest/github/JoshKarpel/counterweight/main)
[![codecov](https://codecov.io/gh/JoshKarpel/counterweight/branch/main/graph/badge.svg?token=2sjP4V0AfY)](https://codecov.io/gh/JoshKarpel/counterweight)[![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
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
```