animaty
Description
animaty is a library for animating ASCII art inside the console. It is made for both Windows and Linux.
Installation
To install animaty just run the following command:
pip install animaty
After that, you can import animaty with
from animaty import *
Documentation
animaty.helpers
getFramesFromFile(file) -> Frame
getFramesFromFile lets you extract frames from a file (The frames in the file must be seperated by a double-newline)
animaty.animate.Frame
The Frame class is used to represent each frame in an animation. It implements getters and setters, I think those need no further explanation.
Frame(content, time=1)
The content variable describes what the Frame displays, while the time variable sets how long the frame has to be displayed (in seconds).
animaty.animate.Animator
The Animator class is responsible for animating the previously created frames
Animator(frames, fps=None)
The frames variable is an array of Frame() instances which will be displayed. The fps variable represents the frames per seconds. If set, the Animator() instance will ignore any time set inside of the given Frame() instances.
animate() -> None
animate starts an animation based on previously entered frames
animationLoop() -> None
animationLoop starts an infinite animation based on previously entered frames
Examples
from animaty import *
frames = getFramesFromFile("test.txt")
animator = Animator(frames)
animator.animate()
First the animaty module gets imported. After that,a frames array is created the getFramesFromFile method, which is then passed into an Animator instance. Finally, the animate method is called, which starts an animation.
from animaty import *
frames = [Frame("just", 0.2), Frame("some", 0.3), Frame("text", 0.4)]
animator = Animator(frames)
animator.animate()
This example is really similair to the previous one, the only difference is that we create a Frame array manually, which gives us some more control over the time the frames are displayed.
To achieve a similair amount of control in example one as in example two, you can use a syntax like this:
frames[0].setFrametime(0.2)
How to contribute
If you want to contribute to this Project, just request an issue on my Github.
Metadata
Release files for animaty 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| animaty-0.1.tar.gz | 3.5 kB | Without provenance | Details |
Release files / animaty-0.1.tar.gz
| Download URL | animaty-0.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4bd9f7790f4955b44db1ff88811353084d793017a5645d107c53b0a7adfd4ce
|
|
BLAKE2b-256 checksum How to use checksums |
43bbb3527467a374971a52e5e16760c99bfa521ebb284b597bc511c24ce094f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
|
Security for animaty 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.