[](https://discord.gg/Enf6Z3qhVr)
[](https://pypi.org/project/textual/)
[](https://badge.fury.io/py/textual)


# Textual
<img align="right" width="250" alt="clock" src="https://github.com/user-attachments/assets/63e839c3-5b8e-478d-b78e-cf7647eb85e8" />
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](https://textual.textualize.io/guide/testing/) framework ensure you can maintain your app for the long-term.
Want some more examples? See the [examples](https://github.com/Textualize/textual/tree/main/examples) directory.
```python
"""
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.
<img src="https://img.spacergif.org/spacer.gif" width="1" height="64"/>
## Widgets
Textual's library of [widgets](https://textual.textualize.io/widget_gallery/) covers everything from buttons, tree controls, data tables, inputs, text areas, and more…
Combined with a flexible [layout](https://textual.textualize.io/how-to/design-a-layout/) system, you can realize any User Interface you need.
Predefined themes ensure your apps will look good out of the box.
<table>
<tr>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>

</td>
<td>

</td>
</tr>
<tr>
<td>

</td>
<td>

</td>
</tr>
</table>
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
## Installing
Install Textual via pip:
```
pip install textual textual-dev
```
See [getting started](https://textual.textualize.io/getting_started/) for details.
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
## Demo
Run the following command to see a little of what Textual can do:
```
python -m textual
```
Or try the [textual demo](https://github.com/textualize/textual-demo) *without* installing (requires [uv](https://docs.astral.sh/uv/)):
```bash
uvx --python 3.12 textual-demo
```
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
## Dev Console
<img align="right" width="40%" alt="devtools" src="https://github.com/user-attachments/assets/12c60d65-e342-4b2f-9372-bae0459a7552" />
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](https://textual.textualize.io/guide/devtools/) for other helpful tools provided by the `textual-dev` package.
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
## 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](https://textual.textualize.io/guide/command_palette/) for your application.

<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
# Textual ❤️ Web
<img align="right" width="40%" alt="textual-serve" src="https://github.com/user-attachments/assets/a25820fb-87ae-433a-858b-ac3940169242">
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](https://github.com/Textualize/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!
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
## Join us on Discord
Join the Textual developers and community on our [Discord Server](https://discord.gg/Enf6Z3qhVr).
Raw data
{
"_id": null,
"home_page": "https://github.com/Textualize/textual",
"name": "textual",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.8.1",
"maintainer_email": null,
"keywords": null,
"author": "Will McGugan",
"author_email": "will@textualize.io",
"download_url": "https://files.pythonhosted.org/packages/41/62/4af4689dd971ed4fb3215467624016d53550bff1df9ca02e7625eec07f8b/textual-2.1.2.tar.gz",
"platform": null,
"description": "\n\n[](https://discord.gg/Enf6Z3qhVr)\n[](https://pypi.org/project/textual/)\n[](https://badge.fury.io/py/textual)\n\n\n\n\n\n\n# Textual\n\n<img align=\"right\" width=\"250\" alt=\"clock\" src=\"https://github.com/user-attachments/assets/63e839c3-5b8e-478d-b78e-cf7647eb85e8\" />\n\nBuild cross-platform user interfaces with a simple Python API. Run your apps in the terminal *or* a web browser.\n\nTextual's API combines modern Python with the best of developments from the web world, for a lean app development experience.\nDe-coupled components and an advanced [testing](https://textual.textualize.io/guide/testing/) framework ensure you can maintain your app for the long-term.\n\nWant some more examples? See the [examples](https://github.com/Textualize/textual/tree/main/examples) directory.\n\n```python\n\"\"\"\nAn App to show the current time.\n\"\"\"\n\nfrom datetime import datetime\n\nfrom textual.app import App, ComposeResult\nfrom textual.widgets import Digits\n\n\nclass ClockApp(App):\n CSS = \"\"\"\n Screen { align: center middle; }\n Digits { width: auto; }\n \"\"\"\n\n def compose(self) -> ComposeResult:\n yield Digits(\"\")\n\n def on_ready(self) -> None:\n self.update_clock()\n self.set_interval(1, self.update_clock)\n\n def update_clock(self) -> None:\n clock = datetime.now().time()\n self.query_one(Digits).update(f\"{clock:%T}\")\n\n\nif __name__ == \"__main__\":\n app = ClockApp()\n app.run()\n```\n\n> [!TIP]\n> Textual is an asynchronous framework under the hood. Which means you can integrate your apps with async libraries — if you want to.\n> If you don't want or need to use async, Textual won't force it on you. \n\n\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"64\"/>\n\n## Widgets\n\nTextual's library of [widgets](https://textual.textualize.io/widget_gallery/) covers everything from buttons, tree controls, data tables, inputs, text areas, and more\u2026\nCombined with a flexible [layout](https://textual.textualize.io/how-to/design-a-layout/) system, you can realize any User Interface you need.\n\nPredefined themes ensure your apps will look good out of the box. \n\n\n<table>\n\n<tr>\n\n <td>\n \n \n \n </td>\n\n <td>\n \n\n \n </td>\n \n</tr>\n\n\n<tr>\n\n <td>\n \n \n \n </td>\n\n <td>\n \n\n \n </td>\n \n</tr>\n<tr>\n\n<td>\n\n\n\n</td>\n\n<td>\n\n\n \n</td>\n\n \n</tr>\n\n</table>\n\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"32\"/>\n\n## Installing\n\nInstall Textual via pip:\n\n```\npip install textual textual-dev\n```\n\nSee [getting started](https://textual.textualize.io/getting_started/) for details.\n\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"32\"/>\n\n## Demo\n\n\nRun the following command to see a little of what Textual can do:\n\n```\npython -m textual\n```\n\nOr try the [textual demo](https://github.com/textualize/textual-demo) *without* installing (requires [uv](https://docs.astral.sh/uv/)):\n\n```bash\nuvx --python 3.12 textual-demo\n```\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"32\"/>\n\n## Dev Console\n\n<img align=\"right\" width=\"40%\" alt=\"devtools\" src=\"https://github.com/user-attachments/assets/12c60d65-e342-4b2f-9372-bae0459a7552\" />\n\n\nHow do you debug an app in the terminal that is also running in the terminal?\n\nThe `textual-dev` package supplies a dev console that connects to your application from another terminal.\nIn addition to system messages and events, your logged messages and print statements will appear in the dev console.\n\nSee [the guide](https://textual.textualize.io/guide/devtools/) for other helpful tools provided by the `textual-dev` package.\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"32\"/>\n\n## Command Palette\n\n\nTextual apps have a *fuzzy search* command palette.\nHit `ctrl+p` to open the command palette.\n\nIt is easy to extend the command palette with [custom commands](https://textual.textualize.io/guide/command_palette/) for your application.\n\n\n\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"32\"/>\n\n# Textual \u2764\ufe0f Web\n\n<img align=\"right\" width=\"40%\" alt=\"textual-serve\" src=\"https://github.com/user-attachments/assets/a25820fb-87ae-433a-858b-ac3940169242\">\n\n\nTextual 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.\nHere's how to serve the demo app:\n\n```\ntextual serve \"python -m textual\"\n```\n\nIn addition to serving your apps locally, you can serve apps with [Textual Web](https://github.com/Textualize/textual-web).\n\nTextual Web's firewall-busting technology can serve an unlimited number of applications.\n\nSince Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device into a connected device.\nNo desktop required!\n\n\n<img src=\"https://img.spacergif.org/spacer.gif\" width=\"1\" height=\"32\"/>\n\n\n## Join us on Discord\n\nJoin the Textual developers and community on our [Discord Server](https://discord.gg/Enf6Z3qhVr).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Modern Text User Interface framework",
"version": "2.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/Textualize/textual/issues",
"Documentation": "https://textual.textualize.io/",
"Homepage": "https://github.com/Textualize/textual",
"Repository": "https://github.com/Textualize/textual"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "07819df1988c908cbba77f10fecb8587496b3dff2838d4510457877a521d87fd",
"md5": "e814b20299572e1563f27f4430442255",
"sha256": "95f37f49e930838e721bba8612f62114d410a3019665b6142adabc14c2fb9611"
},
"downloads": -1,
"filename": "textual-2.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e814b20299572e1563f27f4430442255",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.8.1",
"size": 680148,
"upload_time": "2025-02-26T20:06:34",
"upload_time_iso_8601": "2025-02-26T20:06:34.687049Z",
"url": "https://files.pythonhosted.org/packages/07/81/9df1988c908cbba77f10fecb8587496b3dff2838d4510457877a521d87fd/textual-2.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41624af4689dd971ed4fb3215467624016d53550bff1df9ca02e7625eec07f8b",
"md5": "c28829b7b80e355cbfc969402b693935",
"sha256": "aae3f9fde00c7440be00e3c3ac189e02d014f5298afdc32132f93480f9e09146"
},
"downloads": -1,
"filename": "textual-2.1.2.tar.gz",
"has_sig": false,
"md5_digest": "c28829b7b80e355cbfc969402b693935",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.8.1",
"size": 1596600,
"upload_time": "2025-02-26T20:06:36",
"upload_time_iso_8601": "2025-02-26T20:06:36.425107Z",
"url": "https://files.pythonhosted.org/packages/41/62/4af4689dd971ed4fb3215467624016d53550bff1df9ca02e7625eec07f8b/textual-2.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-26 20:06:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Textualize",
"github_project": "textual",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "textual"
}