Skip to content
/ cuia Public

πŸ§‰πŸŒΏ A delightful tiny framework for building reliable text-based applications

License

Notifications You must be signed in to change notification settings

getcuia/cuia

Folders and files

NameName
Last commit message
Last commit date
Jun 10, 2022
Dec 6, 2021
Dec 9, 2021
Dec 9, 2021
Dec 2, 2021
Dec 9, 2021
Nov 2, 2021
Dec 9, 2021
Dec 6, 2021
Jul 11, 2022
Jul 11, 2022
Dec 6, 2021

Repository files navigation

PyPI Python package PyPI - License

cuia πŸ§‰

cuia

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 (written in Go) and, in particular, employs the Elm architecture (TEA, named after the Elm programming language). 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
  • πŸ–₯️ Support for Unix variants out of the box: curses under the hood by default (and probably works on Windows and DOS if a compatible curses library is available)
  • 🀬 Only one dependency: cusser (for wrapping the curses library)
  • 🐍 Python 3.8+

Installation

$ pip install cuia

Usage

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())

Screenshot