textualeffects
Visual effects for Textual, a TerminalTextEffects wrapper.
Intro
textualeffects is a library that provides Textual bindings for the excellent TerminalTextEffects visual effects library.
Widgets
There are two widgets available in textualeffects, EffectLabel and SplashScreen.
An EffectLabel widget that can be used to display text with a visual effect.
from textual.app import App, ComposeResult
from textualeffects.effects import EffectType
from textualeffects.widgets import EffectLabel
text = ("Hello World! " * 5 + "\n") * 10
effect: EffectType = "Spotlights"
config = {
"search_duration": 500,
"spotlight_count": 3,
}
class TextualEffect(App):
def compose(self) -> ComposeResult:
label = EffectLabel(text, effect=effect, config=config)
label.styles.border = ("heavy", "green")
yield label
if __name__ == "__main__":
app = TextualEffect()
app.run()
A SplashScreen widget that can be used to display a splash screen based on ModalScreen with a visual effect. Once the effect is complete, the splash screen will be dismissed. The user can also dismiss the splash screen by pressing the ESC key.
from textual.app import App, ComposeResult
from textual.widgets import TextArea
from textualeffects.effects import EffectType
from textualeffects.widgets import SplashScreen
effect: EffectType = "Spotlights"
config = {
"search_duration": 100,
"spotlight_count": 3,
}
class SplashEffect(App):
def on_mount(self) -> None:
text = ("Hello World! " * 5 + "\n") * 10
self.push_screen(SplashScreen(text, effect=effect, config=config))
def compose(self) -> ComposeResult:
yield TextArea(("Main content" * 5 + "\n") * 10)
if __name__ == "__main__":
app = SplashEffect()
app.run()
Both widgets accept the following arguments:
text: The text to display.effect: The visual effect to apply to the text. Available effects are exposed through theEffectTypetype.config: A dictionary of configuration options for the effect. The available options depend on the effect. Detailed information on the available options can be found in the TerminalTextEffects documentation.
For convenience, when an effect has run its course, the EffectLabel and SplashScreen widgets will emit a EffectLabel.EffectFinished event.
You can listen for this event to perform any actions:
@on(EffectLabel.EffectFinished)
def do_stuff(self, message: EffectLabel.EffectFinished) -> None:
...
License
This project is licensed under the MIT License.
Metadata
Release files for textualeffects 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| textualeffects-0.2.0.tar.gz | 58.7 kB | Without provenance | Details for textualeffects-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| textualeffects-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for textualeffects-0.2.0-py3-none-any.whl |
Total release size: 63.7 kB
Release files / textualeffects-0.2.0.tar.gz
| Download URL | textualeffects-0.2.0.tar.gz |
|---|---|
| Size | 58.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e42f3865dbdc815831ae8159c9c39d1dd0789b2dea2bc6f8c15c43e2477e5df1
|
|
BLAKE2b-256 checksum How to use checksums |
cc405d28a460c8b3fb071df67dd0fbf1125b0373d0ef5a9105e6a146bacc530d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.14
|
Release files / textualeffects-0.2.0-py3-none-any.whl
| Download URL | textualeffects-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba7cddc87d60b70b3406b49c1463ea2fe2fec3776bbd764339b4edaee2f1e8e4
|
|
BLAKE2b-256 checksum How to use checksums |
ab55a96715300ab7223e0bfeb7fb68edb0fe6cb5f37781c5ff76a9240fcbc09d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.14
|
Security for textualeffects 0.2.0
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.