Yet Another Terminal Spinner
copied from cf-post-staging / yaspinYaspin provides a full-featured terminal spinner to show the progress during long-hanging operations.

It is easy to integrate into existing codebase by using it as a context manager or as a function decorator:
import time
from yaspin import yaspin
# Context manager:
with yaspin():
time.sleep(3) # time consuming code
# Function decorator:
@yaspin(text="Loading...")
def some_operations():
time.sleep(3) # time consuming code
some_operations()
Yaspin also provides an intuitive and powerful API. For example, you can easily summon a shark:
import time
from yaspin import yaspin
with yaspin().white.bold.shark.on_blue as sp:
sp.text = "White bold shark in a blue sea"
time.sleep(5)

$ python script_that_uses_yaspin.py > script.log
$ python script_that_uses_yaspin.py | grep ERROR