Registry / textual-speedups

textual-speedups

JSON →
library0.2.1pypypi✓ verified 26d ago

textual-speedups provides optional Rust-based performance enhancements for the Textual TUI framework. It implements core Textual classes like `Offset`, `Size`, `Region`, and `Spacing` in Rust to potentially make Textual applications faster. Currently at version 0.2.1 (released November 28, 2025), the library is experimental and its development follows the Textual ecosystem, with releases occurring a few times a year.

pip install textual-speedups
INSTALL
IMPORT
SIG · TEXTUAL-SPEEDUPS
T
textual-speedups
pythonv0.2.1
Install
1.6s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Automatic Integration
No direct imports from 'textual_speedups' are typically needed. Once installed, Textual automatically detects and utilizes the Rust speedups.
Users continue to import geometry classes (e.g., Offset, Size) directly from the 'textual.geometry' module; 'textual-speedups' transparently replaces their Python implementations with Rust versions.

To use textual-speedups, simply install it into the same Python environment as your Textual application. Textual will automatically detect and integrate the speedups. The example above is a standard Textual clock app; installing textual-speedups would potentially optimize its underlying Textual operations without requiring any code changes to the app itself.

import os from datetime import datetime from textual.app import App, ComposeResult from textual.widgets import Digits # Set TEXTUAL_SPEEDUPS=0 in your environment to disable speedups for comparison: # os.environ['TEXTUAL_SPEEDUPS'] = '0' 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() # The interval timer and widget updates are areas where # textual-speedups might offer performance benefits. 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()
Debug
Known issues
gotchaTextual-speedups is currently experimental and should not be used in production environments. It is under active development and may not be stable.
fix
Use for development and testing purposes only. Monitor the official Textual and textual-speedups repositories for updates on stability and production readiness.
affects: All versions (0.2.1 and earlier)
gotchaThere is a possibility of encountering edge cases, crashes, or subtle behavioral differences when using textual-speedups due to its experimental nature.
fix
Thoroughly test your Textual application with textual-speedups enabled. Report any issues to the project's GitHub repository. If unexpected behavior occurs, disable the speedups as a first troubleshooting step.
affects: All versions (0.2.1 and earlier)
gotchaFor simpler Textual applications, the performance benefits from textual-speedups might not be noticeable. The speedups primarily target internal geometry and layout calculations, which may only significantly impact complex UIs.
fix
Benchmarking your specific application is recommended to determine if textual-speedups provides a measurable improvement for your use case. Do not expect universal, dramatic speedups across all Textual apps.
affects: All versions (0.2.1 and earlier)
gotchaTo temporarily or permanently disable textual-speedups, an environment variable must be set. This is useful for debugging or comparing performance with and without the speedups.
fix
Set the environment variable `TEXTUAL_SPEEDUPS=0` before running your Textual application. Example: `TEXTUAL_SPEEDUPS=0 python -m textual` or `os.environ['TEXTUAL_SPEEDUPS'] = '0'` within Python before app initialization.
affects: All versions (0.2.1 and earlier)
Upgrade
Version history
0.2.1latest on PyPI · released Nov 28, 2025
Audit
Dependencies
textualrequiredtextual-speedups provides optional performance enhancements for the Textual TUI framework and requires Textual to be installed in the same environment to function. It is not a direct PyPI dependency of textual-speedups, but a peer dependency.
Agent activity
5 hits · last 30 days
node
4
Resources
textual-speedups — pip install textual-speedups · libregistry