Skip to main content

Modern Text User Interface framework

Project description

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.

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

textual-6.9.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

textual-6.9.0-py3-none-any.whl (714.8 kB view details)

Uploaded Python 3

File details

Details for the file textual-6.9.0.tar.gz.

File metadata

  • Download URL: textual-6.9.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Darwin/25.1.0

File hashes

Hashes for textual-6.9.0.tar.gz
Algorithm Hash digest
SHA256 49201129a21f65cc16003ce3855cd941a4de7d58eac9489d0e390ba501d712b6
MD5 b3a3a60fb4a1cb74d4d42a0f90581dd0
BLAKE2b-256 978c774b53a1256fe2649e708b634334d5ce68568d178e55cf3099265c639051

See more details on using hashes here.

File details

Details for the file textual-6.9.0-py3-none-any.whl.

File metadata

  • Download URL: textual-6.9.0-py3-none-any.whl
  • Upload date:
  • Size: 714.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Darwin/25.1.0

File hashes

Hashes for textual-6.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ded2824fcfc7311b09ac440abb6fe248b3c1431d0403dc0d096795c4f18303c
MD5 c754d01497723aeea52dfb1d9f46d3ad
BLAKE2b-256 9d3c76b607e07d5d63d32d4c4e2803f392913e8e07d5a489fa46f5c25e554ea9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page