Textfx is a lightweight Python library for creating dynamic, visually engaging console text effects and Loading Animation.
pip install textfxOr clone & install dependencies:
git clone https://github.com/iliakarimi/textfx.git
cd textfx
pip install -r requirements.txt- Typing Effect
- Scramble Effect
- Wave Text
- Untyping Effect
- Unscramble Effect
- Unwave Text
- Loading Animations
- Color Support via
termcolor
Import the desired effects and loaders:
from textfx import (
typeeffect, scrameffect, wavetext,
untypeeffect, unscrameffect, unwavetext,
SpinnerLoading, ProgressBarLoading, GlitchLoading
)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 ProgressBarLoading(message="Compiling Code", barline=".", animation="⚙", length=40, message_color="cyan", animation_color="yellow", barline_color="white", delay=0.07):
time.sleep(5)For detailed examples, see Documention.
All effects support an optional color parameter (via termcolor):
black
red
green
yellow
blue
magenta
cyan
white
light_grey
dark_grey
light_red
light_green
light_yellow
light_blue
light_magenta
light_cyan
Ensure your terminal supports ANSI colors for
termcoloroutputs.
- Python 3.9+
termcolor
Install dependencies:
pip install -r requirements.txtPull requests are welcome! For more examples and details, refer to docs/examples.md.
MIT License — see LICENSE.
Enjoy using Textfx!