Skip to main content

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:

  1. Clone the repository and include the fate folder in your project:
git clone https://github.com/fredised/fated.git
  1. Or simply copy the fate directory 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 syntax
  • shortcut_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 character
  • blink - Makes text blink
  • fade_in - Gradually reveals text
  • wave - Creates a wave-like animation
  • glitch - Creates a glitchy, distorted effect
  • shake - Shakes the text
  • rainbow - Cycles through rainbow colors
  • typing_with_errors - Realistic typing with random errors
  • matrix_effect - Matrix-like falling character effect
  • slide_in - Slides text in from left or right
  • reveal_masked - Reveals masked text character by character

Project details


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.2.tar.gz (25.4 kB view details)

Uploaded Source

File details

Details for the file fated-0.2.2.tar.gz.

File metadata

  • Download URL: fated-0.2.2.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.10

File hashes

Hashes for fated-0.2.2.tar.gz
Algorithm Hash digest
SHA256 18ca0d94596c4e977e5d14d2bdebc052fdad138e929fc8002483dcc8db012718
MD5 c5d2226670280c805885af6344b29cb6
BLAKE2b-256 2e5e1065d14b50b938853351192eccac3a1cdc82216f7ff52644823d9b575ac1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page