Skip to main content

A Python library for cinematic text effects in command-line interfaces.

Project description

Cinetext

A Python library for creating cinematic and dynamic text effects in your command-line applications.

This new version includes a more consistent API, smoother animations for multi-line text, and more robust parameter handling.

Installation

You can install or update to the latest version of cinetext using pip:

pip install --upgrade cinetext

Usage

First, import the functions you want to use from the library:

from cinetext import cinetext_clear, cinetext_type, cinetext_glitch, cinetext_rainbow, cinetext_pulse

Functions

Here is a breakdown of the available functions and their parameters:

  • cinetext_clear()

    • Clears the entire terminal screen and moves the cursor to the top-left corner.
  • cinetext_type(text, speed=0.04)

    • text (str): The text you want to display with a typewriter effect.
    • speed (float, optional): The time delay in seconds between each character. Defaults to 0.04.
  • cinetext_glitch(text, frames=20, speed=0.08)

    • text (str): The text you want to display with a glitch effect. Can be multi-line.
    • frames (int, optional): The number of animation frames. Defaults to 20.
    • speed (float, optional): The time delay in seconds between each frame. Defaults to 0.08.
  • cinetext_rainbow(text, frames=50, speed=0.05)

    • text (str): The text you want to display with a rainbow wave effect. Can be multi-line.
    • frames (int or float, optional): The number of animation frames. Defaults to 50. If you provide a float (e.g., 0.1), it will be used as the speed and frames will default to 50.
    • speed (float, optional): The time delay in seconds between each frame. Defaults to 0.05.
  • cinetext_pulse(text, cycles=3, speed=0.05)

    • text (str): The text you want to display with a pulsing grayscale effect. Can be multi-line.
    • cycles (int or float, optional): The number of times the text should pulse. Defaults to 3. If you provide a float, it will be used as the speed.
    • speed (float, optional): The time delay in seconds between each frame. Defaults to 0.05.

Example

Here is an example demonstrating how to use the functions to create a cinematic sequence.

from cinetext import cinetext_clear, cinetext_type, cinetext_glitch, cinetext_rainbow, cinetext_pulse

def run_intro():
    logo = r"""
     _______  _________ _        _______ _________ _______             _________ 
    (  ____ \ \__   __/( (    /|(  ____ \__   __/(  ____ \   |\     /|\__   __/
    | (    \/    ) (   |  \  ( || (    \/   ) (   | (    \/   ( \   / )   ) (   
    | |          | |   |   \ | || (__       | |   | (__        \ (_) /    | |   
    | |          | |   | (\ \) ||  __)      | |   |  __)        ) _ (     | |   
    | |          | |   | | \   || (         | |   | (          / ( ) \    | |   
    | (____/\ ___) (___| )  \  || (____/\   | |   | (____/\   ( /   \ )   | |   
    (_______/ \_______/|/    )_)(_______/   )_(   (_______/   |/     \|   )_(   
    """
    
    # 1. Clear the screen
    cinetext_clear()
    
    # 2. Show an initializing message
    cinetext_type(">>> INITIALIZING CINETEXT PROTOCOL...", 0.03)
    
    # 3. Animate the logo with a rainbow effect
    # Note: We can pass speed as the second argument directly
    cinetext_rainbow(logo, 0.02) 
    
    # 4. Glitch the logo for a cool effect
    cinetext_glitch(logo, frames=10)
    
    # 5. Pulse the logo
    cinetext_pulse(logo, cycles=1)
    
    print("\n[SYSTEM READY]")

if __name__ == "__main__":
    run_intro()

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

cinetext-0.3.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cinetext-0.3.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file cinetext-0.3.0.tar.gz.

File metadata

  • Download URL: cinetext-0.3.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cinetext-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6890366a1c126d17303e118b280bb4611d38d4d4a5a7e4a32aadc4307d368784
MD5 e5995e639273bd5ef5c01a09d38c88b4
BLAKE2b-256 42635f247afd98f0f095db0524583cac652e6c88c22caacf0ea587dcf3e9f779

See more details on using hashes here.

File details

Details for the file cinetext-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cinetext-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cinetext-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36f4f992acf580fc76f3a3cc7cd1fec2481ed3313d898831cceb9568a6c50fc9
MD5 34e499d6d543f657bd1951e270715097
BLAKE2b-256 a51be74433aa24e22380876d4732969ab269510a9322b77c37c5d1cfb40ed662

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