Textual is a Python framework for building modern, interactive text-based user interfaces (TUIs) in the terminal. It allows developers to create rich layouts, widgets, tables, and interactive components, all with a responsive design similar to web applications. Textual leverages asyncio for smooth updates and is ideal for dashboards, CLI apps, and terminal-based tools that need a polished, graphical feel without a GUI.
Installation:
pip install textual
Example usage:
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer, Button, Input
class MyApp(App):
def compose(self) -> ComposeResult:
yield Header(show_clock=True)
yield Input(placeholder='enter name...')
yield Button("Click Me")
yield Footer()
MyApp().run()
PyPI page: https://pypi.org/project/textual/
GitHub page: https://github.com/Textualize/textual
3 Project Ideas:
- Build a real-time terminal dashboard for monitoring system metrics.
- Develop a text-based file manager with interactive navigation.
- Create a multi-widget CLI application for task management.
Top comments (0)