Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1k
The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
License
Textualize/textual
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation

Build cross-platform user interfaces with a simple Python API. Run your apps in the terminalor 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 advancedtesting framework ensure you can maintain your app for the long-term.
Want some more examples? See theexamples directory.
"""An App to show the current time."""fromdatetimeimportdatetimefromtextual.appimportApp,ComposeResultfromtextual.widgetsimportDigitsclassClockApp(App):CSS=""" Screen { align: center middle; } Digits { width: auto; } """defcompose(self)->ComposeResult:yieldDigits("")defon_ready(self)->None:self.update_clock()self.set_interval(1,self.update_clock)defupdate_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.
Textual's library ofwidgets covers everything from buttons, tree controls, data tables, inputs, text areas, and more…Combined with a flexiblelayout system, you can realize any User Interface you need.
Predefined themes ensure your apps will look good out of the box.
Install Textual via pip:
pip install textual textual-devSeegetting started for details.
Run the following command to see a little of what Textual can do:
python -m textualOr try thetextual demowithout installing (requiresuv):
uvx --python 3.12 textual-demo

How do you debug an app in the terminal that is also running in the terminal?
Thetextual-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.
Seethe guide for other helpful tools provided by thetextual-dev package.
Textual apps have afuzzy search command palette.Hitctrl+p to open the command palette.
It is easy to extend the command palette withcustom commands for your application.

Textual apps are equally at home in the browser as they are the terminal. Any Textual app may be served withtextual 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 withTextual 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 the Textual developers and community on ourDiscord Server.
About
The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.








