Skip to main content

textual-serve-asgi

ASGI adapter for Textual Serve that allows you to serve Textual apps over the web using the ASGI protocol. It can be used to mount Textual apps into FastAPI/Starlette applications.

Motivation

The original textual-serve library provides a way to serve Textual TUI apps over the web, but it runs as a standalone server. There is no built-in way to mount a Textual app as part of an existing web application.

I needed to embed a Textual app into an existing FastAPI/Starlette project as a mounted sub-application — for example, serving a Textual-based admin panel or monitoring dashboard alongside a REST API. This library bridges that gap by providing a standard ASGI interface for Textual Serve, so you can mount it at any path within your app.

It also ships with the latest xterm.js release, which adds support for in-terminal image rendering — so Textual apps that emit images (via the Kitty/iTerm/Sixel graphics protocols) display them correctly in the browser.

Installation

pip install textual-serve-asgi

# include the CLI and uvicorn for standalone serving
pip install "textual-serve-asgi[server]"

Usage

CLI

Once installed with the server extra, a textual-serve command is available. It accepts the same style of target as textual run:

# serve a Python file
textual-serve path/to/app.py

# serve a module or an installed console script
textual-serve "python -m textual"

# serve an arbitrary shell command
textual-serve -c "python -m textual"

Run textual-serve --help for the full list of options.

Standalone

from textual_serve_asgi.server import Server

server = Server("python -m textual")
server.serve()

Mounted in a Starlette/FastAPI app

from starlette.applications import Starlette

from textual_serve_asgi.server import Server

server = Server("python -m textual")

app = Starlette()
app.mount("/textual", server.asgi_app)

Metadata

Release files for textual-serve-asgi 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for textual-serve-asgi 0.2.1
File Size Uploaded Provenance
textual_serve_asgi-0.2.1.tar.gz 311.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for textual-serve-asgi 0.2.1
File Interpreter ABI Platform
textual_serve_asgi-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 516.7 kB

Release files / textual_serve_asgi-0.2.1.tar.gz

Download URL textual_serve_asgi-0.2.1.tar.gz
Size 311.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bb5b74acdd484d944faa5742745e3e412c93f06cfb88fc41f76a0d8c069e1e72
BLAKE2b-256 checksum
How to use checksums
7ae130027ac77e4cc95d8a22f6fb658728fa403b251fc9a49bd0f2b89f876b70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / textual_serve_asgi-0.2.1-py3-none-any.whl

Download URL textual_serve_asgi-0.2.1-py3-none-any.whl
Size 204.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de34d1f79fba62a2754eaab50c440d96c74e81e2891cadec3d73e156280ad8e4
BLAKE2b-256 checksum
How to use checksums
f43b627b41a6f53b28f1611f8a918060e310752bf657622a677b0e9f7f097c6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for textual-serve-asgi 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page