Introduction to Terminal Text Effects
Terminal Text Effects, often abbreviated as TTE, is a remarkable tool designed to embellish terminal outputs with dynamic visual effects. It offers users the flexibility to function as both a standalone system application and a Python library. This versatility allows developers to incorporate stunning visual effects directly into their scripts or applications.
About Terminal Text Effects (TTE)
TTE is fundamentally a visual effects engine for terminal outputs. It features a suite of built-in effects that showcase its extensive capabilities. Key features include:
- Color Support: It supports both Xterm 256 and RGB hex colors, allowing for a wide range of color customization.
- Complex Character Animations: The engine supports sophisticated animations using Paths, Waypoints, and motion easing, including bezier curves.
- Scene-Based Effects: TTE enables complex scene creation with synchronized symbol, color changes, and progression paths.
- Gradient Generation: Users can create variable stop/step color gradients to enhance the visual appeal of their terminal outputs.
- Event Handling: Incorporates event handling for state changes within Paths or Scenes, supporting custom callbacks and predefined actions.
- Effect Customization: Offers a typed effect configuration dataclass, processed as CLI arguments for seamless customization.
- Preserved Workflow: Runs inline without interrupting terminal state or workflow.
Requirements
Written entirely in Python, TTE does not rely on third-party modules and uses standard ANSI terminal sequences. It is compatible with most modern terminals, with a note that some effects may perform slowly in Windows Terminal.
Installation
To get started with TTE, installation can be done through Pip or Pipx:
pip install terminaltexteffects
OR
pipx install terminaltexteffects
For users of the Nix package manager, TTE can be integrated into a flake or run directly through specific commands detailed in the documentation.
Usage as an Application
To use TTE as a standalone application, users can explore a wide variety of effects. Each effect comes with its specific command line options:
cat your_text | tte <effect> [options]
To explore specific options for each effect, the command <effect> -h
can be used.
Usage as a Library
When used as a Python library, effects are accessible through iterators that generate string representations of each frame. Developers can integrate TTE into Python scripts as shown:
from terminaltexteffects.effects import effect_rain
effect = effect_rain.Rain("your text here")
for frame in effect:
# Process the frame
...
The library also offers a terminal_output()
context manager for handling terminal setups and cursor positioning seamlessly.
Effect Showcase
TTE boasts a selection of visual effects, each distinct in its presentation and animation style including:
- Beams: Traveling beams illuminate characters in their path.
- Bubbles and Bouncy Balls: Characters float or bounce across the terminal.
- Decrypt and Matrix Effects: Create digital rain or decryption visualizations.
- Fireworks and Swarm: Characters mimic firework explosions or swarm movements.
For a comprehensive view of all available effects, users can visit the Effects Showroom linked in the documentation.
Development and Licensing
The project is actively developed with previews of new features regularly shared. It is released under the MIT License, promoting open use and contribution from the community.
In essence, Terminal Text Effects by ChrisBuilds brings a new dimension to terminal outputs, allowing for a rich visual and dynamic experience. Whether for personal amusements or professional uses, TTE is equipped to transform the way text is presented in terminals.