A Python library for adding visual effects to terminal text output
Project description
Fated - Text Effects Library for Python
Fated is a Python library that adds visual effects to text output including typewriter animation and other text styling options. It provides a simple API for creating rich, animated terminal text with no external dependencies.
Features
- Text Animation Effects: Typewriter, blink, fade-in, wave, glitch, shake, matrix, and more
- Text Styling: Colors, background colors, bold, italic, underline, and other text styles
- Chainable Effects: Combine multiple effects together seamlessly
- Simple API: Intuitive interface that works with standard print function
- Alternative Syntax: Use the + operator with shortcut objects for even cleaner code
- No Dependencies: Uses only Python standard library modules
Installation
Install directly from PyPI using pip:
pip install fated
Alternative installation methods:
- Clone the repository and include the
fatefolder in your project:
git clone https://github.com/fredised/fated.git
- Or simply copy the
fatedirectory to your project.
Usage
Traditional Syntax
from fate import typewriter, color, style
# Simple typewriter effect
print(typewriter("Hello, World!"))
# Colored text
print(color.red("This text is red"))
print(color.blue("This text is blue"))
# Text styling
print(style.bold("Bold text"))
print(style.italic("Italic text"))
# Chain multiple effects
print(style.bold(color.green(typewriter("Bold green typewriter text"))))
# Predefined combinations
from fate import error, warning, success, info
print(error("Error message"))
print(success("Success message"))
Shortcut Syntax (New!)
from fate.shortcuts import fateTypeWriter, fateRed, fateBold
# Use the + operator
print(fateTypeWriter + "Hello, World!")
# Colored text
print(fateRed + "This text is red")
# Text styling
print(fateBold + "Bold text")
# Custom parameters
print(fateTypeWriter(speed=20) + "Fast typing!")
# Predefined combinations
from fate.shortcuts import fateError, fateSuccess
print(fateError + "Error message")
print(fateSuccess + "Success message")
Examples
The repository includes example files:
examples.py- Demonstrates the traditional syntaxshortcut_example.py- Demonstrates the new shortcut syntax
Run the examples to see the library in action:
python examples.py
python shortcut_example.py
Available Effects
typewriter- Types text character by characterblink- Makes text blinkfade_in- Gradually reveals textwave- Creates a wave-like animationglitch- Creates a glitchy, distorted effectshake- Shakes the textrainbow- Cycles through rainbow colorstyping_with_errors- Realistic typing with random errorsmatrix_effect- Matrix-like falling character effectslide_in- Slides text in from left or rightreveal_masked- Reveals masked text character by character
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
fated-0.2.1.tar.gz
(25.2 kB
view details)
File details
Details for the file fated-0.2.1.tar.gz.
File metadata
- Download URL: fated-0.2.1.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7130d870f318a7958c5ac83b6b5732c60c8c2cfeb92b006a5dee04b46cd2d62
|
|
| MD5 |
e84ba896d605a0ca2622248303fd542d
|
|
| BLAKE2b-256 |
7c40a0e8879c53298191a18f6613283bbfd180a8d9f2774e955e377b50fafaa9
|