💫 Beautiful spinners for terminal, IPython and Jupyter
Python
3,018
369 commits
updated Jun 16, 2024
Beautiful spinners for terminal, IPython and Jupyter
$ pip install halo
from halo import Halo
spinner = Halo(text='Loading', spinner='dots')
spinner.start()
# Run time consuming work here
# You can also change properties for spinner as and when you want
spinner.stop()
Alternatively, you can use halo with Python's with statement:
from halo import Halo
with Halo(text='Loading', spinner='dots'):
# Run time consuming work here
Finally, you can use halo as a decorator:
from halo import Halo
@Halo(text='Loading', spinner='dots')
def long_running_function():
# Run time consuming work here
pass
long_running_function()
Halo([text|text_color|spinner|animation|placement|color|interval|stream|enabled])textType: str
Text shown along with spinner.
text_colorType: str
Values: grey, red, green, yellow, blue, magenta, cyan, white
Color of the spinner text. Defaults to None.
spinnerType: str|dict
If string, it should be one of the spinners listed in the given json file. If a dict is passed, it should define interval and frames. Something like:
{
'interval': 100,
'frames': ['-', '+', '*', '+', '-']
}
Defaults to dots spinner. For Windows users, it defaults to line spinner.
animationType: str
Values: bounce, marquee
Animation to apply to the text if it's too large and doesn't fit in the terminal. If no animation is defined, the text will be ellipsed.
placementType: str
Values: left, right
Which side of the text the spinner should be displayed. Defaults to left
colorType: str
Values: grey, red, green, yellow, blue, magenta, cyan, white
Color of the spinner. Defaults to cyan.
intervalType: float
Interval between each frame. Defaults to spinner interval (recommended).
streamType: file
Stream to write the output. Defaults to sys.stdout.
enabledType: bool
Enable or disable the spinner. Defaults to True.
Following are the methods available:
spinner.start([text])Starts the spinner. If text is passed, it is set as spinner text. Returns the instance.
spinner.stop()Stops and clears the spinner. Returns the instance.
spinner.clear()Clears the spinner. Returns the instance.
spinner.render()Manually renders a new frame. Returns the instance.
spinner.frame()Returns next frame to be rendered.
spinner.succeed([text])text: Type: strStops the spinner and changes symbol to ✔. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.fail([text])text: Type: strStops the spinner and changes symbol to ✖. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.warn([text])text: Type: strStops the spinner and changes symbol to ⚠. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.info([text])text: Type: strStops the spinner and changes symbol to ℹ. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.stop_and_persist([symbol|text])Stops the spinner and changes symbol and text. Returns the instance.
symbolType: str
Symbol to replace the spinner with. Defaults to ' '.
textType: str
Text to be persisted. Defaults to instance text.
spinner.textChange the text of spinner.
spinner.colorChange the color of spinner
spinner.spinnerChange the spinner itself.
spinner.enabledEnable or disable the spinner.
Please see Contributing guidelines for more information.
🌟 this repo to show support. Let me know you liked it on Twitter. Also, share the project.
MIT © Manraj Singh
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
247 followers · starred Mar 2026
976 followers · starred Nov 2017
496 followers · starred Sep 2026
24,658 followers · starred Oct 2017
💫 Beautiful spinners for terminal, IPython and Jupyter
Python
3,018
369 commits
updated Jun 16, 2024
Beautiful spinners for terminal, IPython and Jupyter
$ pip install halo
from halo import Halo
spinner = Halo(text='Loading', spinner='dots')
spinner.start()
# Run time consuming work here
# You can also change properties for spinner as and when you want
spinner.stop()
Alternatively, you can use halo with Python's with statement:
from halo import Halo
with Halo(text='Loading', spinner='dots'):
# Run time consuming work here
Finally, you can use halo as a decorator:
from halo import Halo
@Halo(text='Loading', spinner='dots')
def long_running_function():
# Run time consuming work here
pass
long_running_function()
Halo([text|text_color|spinner|animation|placement|color|interval|stream|enabled])textType: str
Text shown along with spinner.
text_colorType: str
Values: grey, red, green, yellow, blue, magenta, cyan, white
Color of the spinner text. Defaults to None.
spinnerType: str|dict
If string, it should be one of the spinners listed in the given json file. If a dict is passed, it should define interval and frames. Something like:
{
'interval': 100,
'frames': ['-', '+', '*', '+', '-']
}
Defaults to dots spinner. For Windows users, it defaults to line spinner.
animationType: str
Values: bounce, marquee
Animation to apply to the text if it's too large and doesn't fit in the terminal. If no animation is defined, the text will be ellipsed.
placementType: str
Values: left, right
Which side of the text the spinner should be displayed. Defaults to left
colorType: str
Values: grey, red, green, yellow, blue, magenta, cyan, white
Color of the spinner. Defaults to cyan.
intervalType: float
Interval between each frame. Defaults to spinner interval (recommended).
streamType: file
Stream to write the output. Defaults to sys.stdout.
enabledType: bool
Enable or disable the spinner. Defaults to True.
Following are the methods available:
spinner.start([text])Starts the spinner. If text is passed, it is set as spinner text. Returns the instance.
spinner.stop()Stops and clears the spinner. Returns the instance.
spinner.clear()Clears the spinner. Returns the instance.
spinner.render()Manually renders a new frame. Returns the instance.
spinner.frame()Returns next frame to be rendered.
spinner.succeed([text])text: Type: strStops the spinner and changes symbol to ✔. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.fail([text])text: Type: strStops the spinner and changes symbol to ✖. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.warn([text])text: Type: strStops the spinner and changes symbol to ⚠. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.info([text])text: Type: strStops the spinner and changes symbol to ℹ. If text is provided, it is persisted else current text is persisted. Returns the instance.
spinner.stop_and_persist([symbol|text])Stops the spinner and changes symbol and text. Returns the instance.
symbolType: str
Symbol to replace the spinner with. Defaults to ' '.
textType: str
Text to be persisted. Defaults to instance text.
spinner.textChange the text of spinner.
spinner.colorChange the color of spinner
spinner.spinnerChange the spinner itself.
spinner.enabledEnable or disable the spinner.
Please see Contributing guidelines for more information.
🌟 this repo to show support. Let me know you liked it on Twitter. Also, share the project.
MIT © Manraj Singh
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
247 followers · starred Mar 2026
976 followers · starred Nov 2017
496 followers · starred Sep 2026
24,658 followers · starred Oct 2017