textual 3.0.0
pip install textual
Released:
Modern Text User Interface framework
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Will McGugan
- Requires: Python <4.0.0, >=3.8.1
Classifiers
- Development Status
- Environment
- Intended Audience
- License
- Operating System
- Programming Language
- Typing
Project description
Textual
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.
|
|
|
|
|
|
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
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.
Textual ❤️ Web
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
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Will McGugan
- Requires: Python <4.0.0, >=3.8.1
Classifiers
- Development Status
- Environment
- Intended Audience
- License
- Operating System
- Programming Language
- Typing
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
File details
Details for the file textual-3.0.0.tar.gz
.
File metadata
- Download URL: textual-3.0.0.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.7 Darwin/24.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bf9f8523541340d5357724d60868db652fb287ac7b13e6cf4553d45a6d9a9d5 |
|
MD5 | 99251e4e00bc98b5e7f0a0678c984fe5 |
|
BLAKE2b-256 | 287f9423d4d9e1aabaa6841a7f77e2bf8249a7cae4209c4d6b33d77f55ed24c3 |
File details
Details for the file textual-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: textual-3.0.0-py3-none-any.whl
- Upload date:
- Size: 681.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.7 Darwin/24.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ffa46cff719338e6f34510d9249d76279af32598e311a1505285c436f35ab6 |
|
MD5 | 02094a3c9b9a5988be425ba2c209fa8e |
|
BLAKE2b-256 | d46cc1c5843ef3966fa80974110a99e1ac7e30e2f084dbea58d1c8caec58f2ab |