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

Uploaded Source

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

Hashes for fated-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a7130d870f318a7958c5ac83b6b5732c60c8c2cfeb92b006a5dee04b46cd2d62
MD5 e84ba896d605a0ca2622248303fd542d
BLAKE2b-256 7c40a0e8879c53298191a18f6613283bbfd180a8d9f2774e955e377b50fafaa9

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