https://github.com/soda480/text-animator
A simple text animator.
https://github.com/soda480/text-animator
animation ascii docker pybuilder text
Last synced: about 8 hours ago
JSON representation
A simple text animator.
- Host: GitHub
- URL: https://github.com/soda480/text-animator
- Owner: soda480
- Created: 2023-06-08T18:14:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-09T20:35:20.000Z (almost 3 years ago)
- Last Synced: 2026-02-19T22:41:27.353Z (about 2 months ago)
- Topics: animation, ascii, docker, pybuilder, text
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://radon.readthedocs.io/en/latest/api.html#module-radon.complexity)
[](https://pypi.org/project/bandit/)
[](https://badge.fury.io/py/text-animator)
[](https://www.python.org/downloads/)
# 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](https://pypi.org/project/ascii-animator/0.1.6/) package.
### Installation
```bash
pip install text_animator
```
### Usage
#### [example1](https://github.com/soda480/text-animator/blob/main/examples/example1.py)
Animate some text and display characters from left to right (default).
Code
```Python
from text_animator import TextAnimation
text = """This is the text
that we want to animate
let's see how well
this works ..."""
TextAnimation(text)()
```

#### [example2](https://github.com/soda480/text-animator/blob/main/examples/example2.py)
Animate some text and display characters from right to left.
Code
```Python
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)()
```

#### [example3](https://github.com/soda480/text-animator/blob/main/examples/example3.py)
Animate some text and display characters at random.
Code
```Python
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)()
```

#### [example4](https://github.com/soda480/text-animator/blob/main/examples/example4.py)
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
```Python
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))()
```

### Development
Clone the repository and ensure the latest version of Docker is installed on your development server.
Build the Docker image:
```bash
docker image build \
-t \
text-animator:latest .
```
Run the Docker container:
```bash
docker container run \
--rm \
-it \
-v $PWD:/code \
text-animator:latest \
bash
```
Execute the build:
```sh
pyb -X
```