Skip to main content

🧉🌿 A delightful tiny framework for building reliable text-based applications

Project description

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

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

cuia-0.1.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

cuia-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file cuia-0.1.1.tar.gz.

File metadata

  • Download URL: cuia-0.1.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.13.0-22-generic

File hashes

Hashes for cuia-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c83a6eb3bdb308abbab82a92abeb417af9fe5416acadf45f4723b0da63b46402
MD5 7016ab5a659b32f12724dc8f4cb26ec4
BLAKE2b-256 9bb5cdde8e6baabe381da761e75e5504ae0ffeb6b3b71f427b61c8cb8d303ffe

See more details on using hashes here.

File details

Details for the file cuia-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cuia-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.13.0-22-generic

File hashes

Hashes for cuia-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 487a7f57e44f94a95ca4ace9c4e4abbe7339bb92ce74f98de04ac5d793d4d6cd
MD5 fdd0f22a1b19e4f8d4051a643fa82c85
BLAKE2b-256 36267621de36c066dca400fbe59c5ef15218d0d77090dc5b81c3c263a51a2d55

See more details on using hashes here.

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