Skip to main content

animation

Tools for terminal-based wait animations

Installation

git clone http://github.com/bprinty/animation.git
cd animation
python setup.py install

Documentation

Documentation for the package can be found at Read The Docs.

Usage

The animation module provides decorators for doing terminal-based wait animations. To add a wait animation to a function that requires some processing time, simply decorate the function with the wait animation you want to use.

Here is an example of how to use it in a project:

import animation
import time

@animation.simple_wait
def long_running_function():
    ... 5 seconds later ...
    return

This will print an animated waiting message like this (the elipses at the end of the text grow and shrink while the function executes):

waiting ...

The animation types provided by default are:

  • bar (simple bar that slides back and forth)

  • spinner (a spinning line)

  • dots (dots that move around in a sqare)

  • elipses (elipses that grow and shrink)

  • text with elipses (elipses with text in front of them)

And you can use any of these built-in animations like so:

import animation
import time

@animation.wait('bar')
def long_running_function():
    ... 5 seconds later ...
    return

@animation.wait('spinner')
def long_running_function():
    ... 5 seconds later ...
    return

In addition to these default types, the module also supports custom animations. For example, to create an animation with a counter-clockwise spinning wheel:

wheel = ('-', '/', '|', '\\')
@animation.wait(wheel)
def long_running_function():
    ... 5 seconds later ...
    return

If you want to manually start and stop the wait animation, you can use the `animation.Wait` class:

wait = animation.Wait()
wait.start()
long_running_function()
wait.stop()

Finally, you can change the color of animations with the `color=` argument:

import animation

@animation.wait('bar', color='blue')
def long_running_function():
    ... 5 seconds later ...
    return

Questions/Feedback

File an issue in the GitHub issue tracker.

Metadata

Release files for animation 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for animation 0.0.7
File Size Uploaded Provenance Actions
animation-0.0.7.tar.gz 6.7 kB Without provenance Details for animation-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for animation 0.0.7
File Interpreter ABI Platform Actions
animation-0.0.7-py2.py3-none-any.whl Python 3, Python 2 none any Details for animation-0.0.7-py2.py3-none-any.whl

Total release size: 12.0 kB

Release files / animation-0.0.7.tar.gz

Download URL animation-0.0.7.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
764b57a5f2153378d5d8c9a8b95750b5d48249ba9ff1c09e50940d3e1c648e9f
BLAKE2b-256 checksum
How to use checksums
c93b86902d63edc1329318e40d1d13c5edf7cfed4cbf5bc2a783d55b9d856637
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Release files / animation-0.0.7-py2.py3-none-any.whl

Download URL animation-0.0.7-py2.py3-none-any.whl
Size 5.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c4210e410aac09e3632238cb6e70430cf4d8134dc2793c910a2f28275faa4cb1
BLAKE2b-256 checksum
How to use checksums
d90addd459091f3c00c3dda1d3c14b15d999f15f28d95e372abee69dab280a4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.1

Security for animation 0.0.7

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page