Skip to main content

textual-hmr

PyPI - Version

Provides Hot Module Reloading for Textual apps.

It acts as a small runner for Textual development: save Python files, and the current app instance exits so the updated app can be started again in the same Python process. When you export an App subclass, textual-hmr also enables Textual's built-in CSS watching by default.

CLI Usage

If your app class is named DemoApp in ./main.py, run:

textual-hmr ./main.py:DemoApp

Or use a module import path:

textual-hmr my_package.main:DemoApp

The target may be:

  • an App subclass
  • an App instance
  • a zero-argument callable returning an App

Options

textual-hmr --help

The command supports:

  • --watch PATH: additional file or directory paths to watch
  • --ignore PATH: file or directory paths to ignore
  • --headless: run without terminal output
  • --inline: use Textual inline mode
  • --inline-no-clear: preserve inline output after exit
  • --no-mouse: disable mouse support
  • --clear: clear the terminal before restarting after changes
  • --no-watch-css: do not enable Textual's CSS watcher when the target is an App subclass

Notes

  • This package is currently optimized for the common dev loop of restarting a Textual app quickly in-process when code changes.
  • It does not attempt to preserve widget state across app restarts.
  • For CSS-only changes, Textual's own watcher is usually the smoother path; textual-hmr enables that automatically for exported app classes unless you disable it.

Metadata

Release files for textual-hmr 0.0.2

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

Built distribution (wheel)

Table of built distributions (wheels) for textual-hmr 0.0.2
File Interpreter ABI Platform
textual_hmr-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / textual_hmr-0.0.2-py3-none-any.whl

Download URL textual_hmr-0.0.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49147eb459dac52408e54aab02d4980d8be180ee92bb66b0180e20bfa2a881dd
BLAKE2b-256 checksum
How to use checksums
9997d990ee0ecc6aa0ab1b7fa106d6e421d6175e37ca4e14ef7e167a993e2815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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 history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

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