Skip to main content

A simple text animator

Project description

complexity vulnerabilities PyPI version python

text-animator

A simple text animator.

Ths is a subclass of the Animation abstract class and uses the Animator class to display the animated text to the terminal; both classes are defined in the ascii-animator package.

Installation

pip install text_animator

Usage

example1

Animate some text and display characters from left to right (default).

Code
from text_animator import TextAnimation
text = """This is the text
    that we want to animate
    let's see how well
    this works ..."""
TextAnimation(text)()

example1

example2

Animate some text and display characters from right to left.

Code
from text_animator import TextAnimation, Effect
text = """This is the text
    that we want to animate
    let's see how well
    this works ..."""
TextAnimation(text, effect=Effect.RIGHT_TO_LEFT)()

example2

example3

Animate some text and display characters at random.

Code
from text_animator import TextAnimation, Effect
text = """This is the text
    that we want to animate
    let's see how well
    this works ..."""
TextAnimation(text, effect=Effect.RANDOM)()

example3

example4

Animate some text and display characters from left to right then surround text with a border. A border can be customized with top|bottom|left|right margins as well as top|bottom|left|right padding, default for all margins and padding is 1. Margins define the space outside the border, and padding define the space between the border and text.

Code
from text_animator import TextAnimation, Effect, Border
text = """This is the text
    that we want to animate
    let's see how well
    this works ..."""
TextAnimation(text, border=Border(lm=0, tm=0, bm=0, tp=0, bp=0))()

example4

Development

Clone the repository and ensure the latest version of Docker is installed on your development server.

Build the Docker image:

docker image build \
-t \
text-animator:latest .

Run the Docker container:

docker container run \
--rm \
-it \
-v $PWD:/code \
text-animator:latest \
bash

Execute the build:

pyb -X

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

text-animator-0.1.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

text_animator-0.1.0-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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