https://github.com/getcuia/cuia
๐ง๐ฟ A delightful tiny framework for building reliable text-based applications
https://github.com/getcuia/cuia
ansi cli command-line console cuia elm-architecture framework functional gui python simple terminal terminal-based toolkit tui ui user-interface
Last synced: about 1 year ago
JSON representation
๐ง๐ฟ A delightful tiny framework for building reliable text-based applications
- Host: GitHub
- URL: https://github.com/getcuia/cuia
- Owner: getcuia
- License: mit
- Created: 2021-11-02T15:27:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T05:04:56.000Z (over 3 years ago)
- Last Synced: 2025-05-06T08:54:27.132Z (about 1 year ago)
- Topics: ansi, cli, command-line, console, cuia, elm-architecture, framework, functional, gui, python, simple, terminal, terminal-based, toolkit, tui, ui, user-interface
- Language: Python
- Homepage: https://pypi.org/project/cuia/
- Size: 468 KB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/cuia/)
[](https://github.com/getcuia/cuia/actions/workflows/python-package.yml)
[](https://github.com/getcuia/cuia/blob/main/LICENSE)
# [cuia](https://github.com/getcuia/cuia#readme) ๐ง
> A delightful tiny framework for building reliable text-based applications.
**cuia** is a tiny Python library for building interactive terminal user
interfaces that are easy to use, fast and have a small memory footprint.
cuia is inspired by [Bubble Tea](https://github.com/charmbracelet/bubbletea)
(written in [Go](https://golang.org/)) and, in particular, employs
[the Elm architecture](https://guide.elm-lang.org/architecture/) (TEA, named
after the [Elm programming language](https://elm-lang.org/)). This means that
**cuia applications are as dynamic and easy to write (and use) as they could
be**.
## Features
- ๐งต Simple: your user interface is a string of characters
- ๐ฌ Interaction-focused
- โป๏ธ Easily integrate with other libraries
- ๐น๏ธ Use the same escape code sequences
[as you would with Colorama](https://github.com/tartley/colorama#recognised-ansi-sequences)
- ๐ฅ๏ธ Support for Unix variants out of the box:
[curses](https://docs.python.org/3/library/curses.html) under the hood by
default (and probably works on Windows and DOS if a compatible curses
library is available)
- ๐คฌ Only one dependency: [cusser](https://github.com/getcuia/cusser) (for
wrapping the curses library)
- ๐ Python 3.8+
## Installation
```console
$ pip install cuia
```
## Usage
```python
In [1]: import asyncio
In [2]: from dataclasses import dataclass
In [3]: from cuia import Program, Store
In [4]: @dataclass
...: class Hello(Store):
...:
...: x: int = 0
...: y: int = 0
...:
...: def __str__(self):
...: return f"\033[{self.x};{self.y}H\033[1mHello, ๐!"
...:
In [5]: program = Program(Hello(34, 12))
In [6]: asyncio.run(program.start())
```
