Skip to main content

Tools for terminal-based await animations

Project description

Tools for terminal-based wait animations


git clone
cd animation
python install


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


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

def long_running_function():
    ... 5 seconds later ...

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

def long_running_function():
    ... 5 seconds later ...

def long_running_function():
    ... 5 seconds later ...

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 = ('-', '/', '|', '\\')
def long_running_function():
    ... 5 seconds later ...

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

wait = animation.Wait()


File an issue in the GitHub issue tracker.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for animation, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size animation-0.0.4.tar.gz (8.9 kB) File type Source Python version None Upload date Hashes View
Filename, size animation-0.0.4-py2.py3-none-any.whl (5.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page