Tiny package for fast implementing the simpliest tui on Python
Project description
Tiny TUI
A very small library with no dependencies, written in pure Python to create simple text interfaces (TUI) in Python.
What is Tiny TUI?
Tiny TUI is a small Python library for building simple menus and text interfaces without third-party dependencies. It allows you to quickly and easily build menus and submenus, linking actions to them (if required).
What is implemented at the moment
- Simple menu model and menu items
- Nested menus
- Navigation using arrows (color selection of the selected menu item)
- Use of parameters and settings (if any actions require input from the user)
Installation
pip install tiny-tui
Basic Example
At the moment, the library fills in keywords (such as "exit", "settings" and "back") in Russian. This will be fixed in the future.
from tiny_tui import Menu, App
def hello(ctx):
print("Hello, World!")
submenu: Menu = Menu(
title="Submenu",
items={
"Do nothing": None
}
)
head_menu: Menu = Menu(
title="Main menu",
items={
"Call function": hello,
"Go to submenu": submenu}
)
app: App = App(head_menu=head_menu)
app.run()
Project Status
Early stage
- API may change
- Feedback is welcome
- The project is intentionally kept small
Contributing
Issues, ideas, and pull requests are welcome.
If you find a bug or have a suggestion:
- open an issue
- describe the use case
- keep it simple
License
MIT License
Tiny TUI(Русский)
Очень маленькая библиотека без зависимостей, написанная на чистом Python для создания простых текстовых интерфейсов (TUI) на Python.
Что такое Tiny TUI?
Tiny TUI — это маленькая Python-библиотека для построения простых меню и текстовых интерфейсов без сторонних зависимостей. Она позволяет достаточно быстрым и простым образом строить меню и подменю, привязывая к ним действия(если требуется).
Что реализовано на данный момент
- Простая модель меню и пунктов меню
- Вложенные меню
- Навигация с помощью стрелок(цветовое выделение выбранного пункта меню)
- Использование параметров и настроек(если какие-то действия требуют ввода от пользователя)
Установка
pip install tiny-tui
Пример использования
from tiny_tui import Menu, App
def hello(ctx):
print("Привет, мир!")
submenu: Menu = Menu(
title="Подменю",
items={
"Ничего не делать": None
}
)
head_menu: Menu = Menu(
title="Главное меню",
items={
"Выполнить функцию": hello,
"Перейти в подменю": submenu}
)
app: App = App(head_menu=head_menu)
app.run()
Статус проекта
Ранняя стадия разработки
- API может меняться
- Обратная связь приветствуется
- Проект намеренно остаётся небольшим
Участие в разработке
Идеи, баг-репорты и pull request'ы приветствуются.
Лицензия
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tiny_tui-0.0.1024.tar.gz.
File metadata
- Download URL: tiny_tui-0.0.1024.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2bcf117d161a253a62afe585041bd95234dc9cb5f9108932a154678e76f8a9f
|
|
| MD5 |
60f7dcd9ce5d98a5109077193e8e7e71
|
|
| BLAKE2b-256 |
1a0d2e4a0a1830291e3860f0cf5ef6cdf2812670f3abd7d942131354e5cb6c99
|
File details
Details for the file tiny_tui-0.0.1024-py3-none-any.whl.
File metadata
- Download URL: tiny_tui-0.0.1024-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fd057cb9228e4985904b095868a6af34b6d82ca3e33fac46040563a4b9d24fe
|
|
| MD5 |
46c5143f3501388258a3c1c12a77848d
|
|
| BLAKE2b-256 |
bcd04b4c03fc775158425de92991bd34acac0992638e69ea81aed948244ff734
|