textual

Modern Text User Interface framework

MIT 253 个版本 Python <4.0,>=3.9
Will McGugan <will@textualize.io>
安装
pip install textual
poetry add textual
pipenv install textual
conda install textual
描述

Discord Supported Python Versions PyPI version OS support

textual-splash

Textual

clock

Build cross-platform user interfaces with a simple Python API. Run your apps in the terminal or a web browser.

Textual's API combines modern Python with the best of developments from the web world, for a lean app development experience. De-coupled components and an advanced testing framework ensure you can maintain your app for the long-term.

Want some more examples? See the examples directory.

"""
An App to show the current time.
"""

from datetime import datetime

from textual.app import App, ComposeResult
from textual.widgets import Digits


class ClockApp(App):
    CSS = """
    Screen { align: center middle; }
    Digits { width: auto; }
    """

    def compose(self) -> ComposeResult:
        yield Digits("")

    def on_ready(self) -> None:
        self.update_clock()
        self.set_interval(1, self.update_clock)

    def update_clock(self) -> None:
        clock = datetime.now().time()
        self.query_one(Digits).update(f"{clock:%T}")


if __name__ == "__main__":
    app = ClockApp()
    app.run()

[!TIP] Textual is an asynchronous framework under the hood. Which means you can integrate your apps with async libraries — if you want to. If you don't want or need to use async, Textual won't force it on you.

Widgets

Textual's library of widgets covers everything from buttons, tree controls, data tables, inputs, text areas, and more… Combined with a flexible layout system, you can realize any User Interface you need.

Predefined themes ensure your apps will look good out of the box.

buttons

tree

datatables

inputs

listview

textarea

Installing

Install Textual via pip:

pip install textual textual-dev

See getting started for details.

Demo

Run the following command to see a little of what Textual can do:

python -m textual

Or try the textual demo without installing (requires uv):

uvx --python 3.12 textual-demo

Dev Console

devtools

How do you debug an app in the terminal that is also running in the terminal?

The textual-dev package supplies a dev console that connects to your application from another terminal. In addition to system messages and events, your logged messages and print statements will appear in the dev console.

See the guide for other helpful tools provided by the textual-dev package.

Command Palette

Textual apps have a fuzzy search command palette. Hit ctrl+p to open the command palette.

It is easy to extend the command palette with custom commands for your application.

Command Palette

Textual ❤️ Web

textual-serve

Textual apps are equally at home in the browser as they are the terminal. Any Textual app may be served with textual serve — so you can share your creations on the web. Here's how to serve the demo app:

textual serve "python -m textual"

In addition to serving your apps locally, you can serve apps with Textual Web.

Textual Web's firewall-busting technology can serve an unlimited number of applications.

Since Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device into a connected device. No desktop required!

Join us on Discord

Join the Textual developers and community on our Discord Server.

版本列表
8.2.7 2026-05-19
8.2.6 2026-05-13
8.2.5 2026-04-30
8.2.4 2026-04-19
8.2.3 2026-04-05
8.2.2 2026-04-03
8.2.1 2026-03-29
8.2.0 2026-03-27
8.1.1 2026-03-10
8.1.0 2026-03-10
8.0.2 2026-03-03
8.0.1 2026-03-01
8.0.0 2026-02-16
7.5.0 2026-01-30
7.4.0 2026-01-25
7.3.0 2026-01-15
7.2.0 2026-01-11
7.1.0 2026-01-10
7.0.3 2026-01-09
7.0.2 2026-01-09
7.0.1 2026-01-07
7.0.0 2026-01-03
6.12.0 2026-01-02
6.11.0 2025-12-18
6.10.0 2025-12-16
6.9.0 2025-12-14
6.8.0 2025-12-07
6.7.1 2025-12-01
6.7.0 2025-11-29
6.6.0 2025-11-10
6.5.0 2025-10-31
6.4.0 2025-10-22
6.3.0 2025-10-11
6.2.1 2025-10-01
6.2.0 2025-09-30
6.1.0 2025-09-02
6.0.0 2025-08-31
5.3.0 2025-08-07
5.2.0 2025-08-01
5.1.1 2025-07-31
5.1.0 2025-07-31
5.0.1 2025-07-25
5.0.0 2025-07-25
4.1.0 2025-07-25
4.0.0 2025-07-12
3.7.1 2025-07-09
3.7.0 2025-07-07
3.6.0 2025-07-06
3.5.0 2025-06-20
3.4.0 2025-06-14
3.3.0 2025-06-01
3.2.0 2025-05-02
3.1.1 2025-04-22
3.1.0 2025-04-12
3.0.1 2025-04-01
3.0.0 2025-03-27
2.1.2 2025-02-26
2.1.1 2025-02-22
2.1.0 2025-02-19
2.0.4 2025-02-17
2.0.3 2025-02-16
2.0.2 2025-02-16
2.0.1 2025-02-16
2.0.0 2025-02-16
1.0.0 2024-12-12
0.89.1 2024-12-05
0.89.0 2024-12-05
0.88.1 2024-11-30
0.88.0 2024-11-29
0.87.1 2024-11-24
0.87.0 2024-11-24
0.86.3 2024-11-19
0.86.2 2024-11-18
0.86.1 2024-11-16
0.86.0 2024-11-16
0.85.2 2024-11-02
0.85.1 2024-10-26
0.85.0 2024-10-25
0.84.0 2024-10-22
0.83.0 2024-10-10
0.82.0 2024-10-03
0.81.0 2024-09-25
0.80.1 2024-09-24
0.80.0 2024-09-23
0.79.1 2024-08-31
0.79.0 2024-08-30
0.78.0 2024-08-27
0.77.0 2024-08-22
0.76.0 2024-08-09
0.75.1 2024-08-02
0.75.0 2024-08-01
0.74.0 2024-07-25
0.73.0 2024-07-18
0.72.0 2024-07-09
0.72.0a1 2024-07-09
0.72.0a0 2024-07-09
0.71.0 2024-06-29
0.70.0 2024-06-19
0.69.0 2024-06-16
0.68.0 2024-06-14
0.67.1 2024-06-11
0.67.0 2024-06-11
0.66.0 2024-06-08
0.65.2 2024-06-06
0.65.1 2024-06-05
0.65.0 2024-06-05
0.64.0 2024-06-03
0.63.6 2024-05-29
0.63.5 2024-05-28
0.63.4 2024-05-26
0.63.3 2024-05-24
0.63.2 2024-05-23
0.63.1 2024-05-22
0.63.0 2024-05-22
0.62.0 2024-05-20
0.61.1 2024-05-19
0.61.0 2024-05-18
0.60.1 2024-05-15
0.60.0 2024-05-14
0.59.0 2024-05-11
0.58.1 2024-05-01
0.58.0 2024-04-25
0.57.1 2024-04-20
0.57.0 2024-04-19
0.56.4 2024-04-09
0.56.3 2024-04-08
0.56.2 2024-04-07
0.56.1 2024-04-07
0.56.0 2024-04-06
0.55.1 2024-04-02
0.55.0 2024-04-01
0.54.0 2024-03-26
0.53.1 2024-03-18
0.53.0 2024-03-18
0.52.1 2024-02-20
0.52.0 2024-02-19
0.51.0 2024-02-15
0.50.1 2024-02-09
0.50.0 2024-02-08
0.49.0 2024-02-07
0.48.2 2024-02-02
0.48.1 2024-02-01
0.48.0 2024-02-01
0.47.1 2024-01-05
0.47.0 2024-01-04
0.46.0 2023-12-17
0.45.1 2023-12-12
0.45.0 2023-12-12
0.44.1 2023-12-04
0.44.0 2023-12-01
0.43.2 2023-11-29
0.43.1 2023-11-29
0.43.0 2023-11-28
0.42.0 2023-11-22
0.41.0 2023-10-31
0.40.0 2023-10-11
0.39.0 2023-10-10
0.38.1 2023-09-21
0.38.0 2023-09-21
0.38.1a0 2023-09-21
0.37.1 2023-09-16
0.37.0 2023-09-15
0.36.0 2023-09-05
0.35.1 2023-08-27
0.35.0 2023-08-26
0.35.0a1 2023-08-22
0.34.0 2023-08-22
0.33.0 2023-08-15
0.32.0 2023-08-03
0.31.0 2023-08-01
0.30.0 2023-07-17
0.29.0 2023-07-03
0.29.0a2 2023-07-03
0.29.0a1 2023-06-27
0.28.1 2023-06-20
0.28.0 2023-06-19
0.27.0 2023-06-01
0.26.0 2023-05-20
0.25.0 2023-05-17
0.24.1 2023-05-08
0.24.0 2023-05-08
0.23.0 2023-05-03
0.22.3 2023-04-28
0.22.2 2023-04-28
0.22.1 2023-04-28
0.22.0 2023-04-27
0.21.0 2023-04-26
0.20.1 2023-04-18
0.20.0 2023-04-18
0.19.1 2023-04-10
0.19.0 2023-04-07
0.18.0 2023-04-04
0.17.3 2023-04-02
0.17.2 2023-04-02
0.17.1 2023-03-30
0.17.0 2023-03-29
0.16.0 2023-03-22
0.15.1 2023-03-14
0.15.0 2023-03-13
0.14.0 2023-03-09
0.13.0 2023-03-02
0.12.1 2023-02-25
0.12.0 2023-02-24
0.11.1 2023-02-17
0.11.0 2023-02-15
0.10.1 2023-01-20
0.10.0 2023-01-19
0.9.1 2022-12-30
0.9.0 2022-12-30
0.8.2 2022-12-28
0.8.1 2022-12-25
0.8.0 2022-12-22
0.7.0 2022-12-17
0.6.0 2022-12-11
0.5.0 2022-11-20
0.4.0 2022-11-08
0.4.0a3 2022-11-07
0.4.0a1 2022-11-07
0.3.0 2022-10-31
0.2.1 2022-10-22
0.2.0 2022-10-22
0.2.0rc1 2022-10-22
0.2.0b9 2022-10-22
0.2.0b8 2022-10-20
0.2.0b7 2022-10-17
0.2.0b6 2022-10-17
0.2.0b5 2022-10-06
0.2.0b4 2022-10-05
0.2.0b3 2022-10-05
0.2.0b2 2022-10-05
0.2.0b12 2022-10-22
0.2.0b11 2022-10-22
0.2.0b10 2022-10-22
0.2.0b1 2022-10-05
0.1.18 2022-04-30
0.1.17 2022-03-10
0.1.16 2022-03-10
0.1.15 2022-01-31
0.1.14 2022-01-09
0.1.13 2022-01-01
0.1.12 2021-09-20
0.1.11 2021-09-12
0.1.10 2021-08-25
0.1.9 2021-08-06
0.1.8 2021-07-17
0.1.7 2021-07-14
0.1.6 2021-07-12
0.1.5 2021-07-05
0.1.4 2021-07-05
0.1.3 2021-07-05
0.1.2 2021-06-24
0.1.1 2021-06-19
0.1.0 2021-06-03