Textfx is a lightweight Python library for creating dynamic, visually engaging console text effects and Loading Animation.
pip install textfx
Or clone & install dependencies:
git clone https://github.com/iliakarimi/textfx.git
cd textfx
pip install -r requirements.txt
- Typing Effect (
typeeffect
) - Scramble Effect (
scrameffect
) - Wave Text (
wavetext
) - Untyping Effect (
untypeeffect
) - Unscramble Effect (
unscrameffect
) - Unwave Text (
unwavetext
) - Loading Animations (more new loading in v2.2)
- Color Support via
termcolor
Import the desired effects and loaders:
from textfx import (
typeeffect, scrameffect, wavetext,
untypeeffect, unscrameffect, unwavetext,
SpinnerLoading, ProgressBarLoading, GlitchLoading
)
For detailed examples, see docs/examples.md
.
All loader classes share these parameters:
message
(str): Prefix text displayed before the animation.end_message
(str): Text displayed after the loader stops.delay
(float): Seconds between animation frames.
Classic spinner cursor:
with SpinnerLoading(
message="Processing...",
animation="⠋⠙⠸⠴⠦⠇",
delay=0.1
):
do_work()
Animated bar moving back and forth:
with ProgressBarLoading(
barline='-', animation='█', length=30,
message="Loading", delay=0.05
):
do_work()
Random-character glitch effect:
with GlitchLoading(
text="Decrypting...",
delay=0.1
):
do_work()
All effects support an optional color
parameter (via termcolor
):
grey, red, green, yellow, blue, magenta, cyan, white
Ensure your terminal supports ANSI colors for
termcolor
outputs.
- Python 3.9+
termcolor
Install dependencies:
pip install -r requirements.txt
Pull requests are welcome! For more examples and details, refer to docs/examples.md
.
MIT License — see LICENSE.
Enjoy using Textfx!