textfx is a Python library for creating dynamic and visually engaging text effects.
Project description
Textfx
Textfx is a Python library for creating dynamic and visually engaging text effects. It offers multiple functions to display text with unique animations and styles — perfect for enhancing console-based projects.
Features
- Typing Effect: Simulates the effect of typing text character by character.
- Scramble Effect: Displays random characters that gradually transform into the actual text.
- Wave Text: Makes the text move in a wave-like pattern.
- Untyping Effect: Gradually erases text character by character.
- Unscramble Effect: The text gradually scrambles into random characters until it disappears.
- Unwave Text: The text starts in a wave-like pattern and gradually stabilizes.
- Loading: Display a loading animation using a customizable animation. New!
- ✅ Color Support: All effects now support colored text using
termcolor.
Installation
You can install it with:
pip install textfx
Or clone this repository and use the textfx.py file directly in your project:
git clone https://github.com/iliakarimi/textfx.git
cd textfx
pip install -r requirements.txt
Then, import the required functions in your Python script:
from textfx import typeeffect, scrameffect, wavetext, untypeeffect, unscrameffect, unwavetext, Loading
Usage
Typing Effect
from textfx import typeeffect
typeeffect("Hello, world!", color="cyan", delay=0.1)
Scramble Effect
from textfx import scrameffect
scrameffect("Scrambled Text", color="green", delay=0.1)
Wave Text
from textfx import wavetext
wavetext("Wave Text", color="yellow", delay=0.1)
Untyping Effect
from textfx import untypeeffect
untypeeffect("Erasing Text", color="gray", delay=0.1)
Unscramble Effect
from textfx import unscrameffect
unscrameffect("Glitching Away", color="blue", delay=0.1)
Unwave Text
from textfx import unwavetext
unwavetext("Steadying Waves", color="red", delay=0.1)
Loading
from textfx import Loading
with Loading("Processing..."):
# do something
time.sleep(5)
You can customize the spinner animation:
Loading(animation=".oO@* ")
Or change the text and delay:
Loading(message="Waiting", animation="⠋⠙⠸⠴⠦⠇", delay=0.2, end_message="Finished!")
🎨 Color Options
All effects support colored text using the color parameter.
You can choose from the following colors:
grey, red, green, yellow, blue, magenta, cyan, white
Example:
typeeffect("This is red text!", color="red", delay=0.1)
💡 Color support may depend on your terminal. Most modern terminals support
termcoloroutputs.
For more details, see termcolor documentation.
Dependencies
- Python 3.9 or above
termcolor
You can install the required dependencies using:
pip install -r requirements.txt
Contributing
Feel free to fork this repository and submit pull requests. Suggestions for new effects and improvements are always welcome!
License
This project is licensed under the MIT License. See the LICENSE file for details.
🎉 Enjoy using Textfx!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textfx-2.1.1.tar.gz.
File metadata
- Download URL: textfx-2.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bdf8c6cae6a737bf463e6a15f62a65b4fc8409479b32448f12d845a0db1c825
|
|
| MD5 |
ce5bf6f263d97979162292b5173b3609
|
|
| BLAKE2b-256 |
09aa3a6da99d17cfbef0ea9447184e4eea653982e35bb652aad15d651d8a81a3
|
File details
Details for the file textfx-2.1.1-py3-none-any.whl.
File metadata
- Download URL: textfx-2.1.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f02f53ebee67e2b7cc9cd2377f55ce3d46a202a6ea197611aa496a16c063dc8
|
|
| MD5 |
58e29f6d565e14c6e40fe52c118b1a0f
|
|
| BLAKE2b-256 |
d4ddaa49c7b16c301e4a589551d407ed3db6baecf806cd496d471a99a8d94ef8
|