Make your Python scripts more user friendly with loading animations
Project description
pynimbar
pynimbar
is a Python package that provides a simple and customizable loading animation for console-based applications. The package allows you to create loading animations with custom text, as well as adjust the animation speed and style.
Installation
You can install pynimbar
using pip:
pip install pynimbar
Usage
pynimbar
provides a context manager that allows you to use the loading animation as a context manager. This can be useful if you want to ensure that the loading animation is automatically stopped when an error occurs or when your code finishes executing. For example:
from pynimbar import loading_animation
from time import sleep
with loading_animation('Processing data...'):
sleep(5)
Customization
You can customize the appearance and behavior of the loading animation using the following parameters:
text
(str): The text to display during the animation.success_msg
(str, optional): The text to display when the animation is done. Defaults to'ok'
.animation_frequency
(float, optional): The frequency of the animation. Defaults to0.1
.break_on_error
(bool, optional): Whether to break on error. Defaults toTrue
.verbose_errors
(bool, optional): Whether to print the error traceback. Defaults toFalse
.frames
(str, optional): The frames of the animation. Defaults to'|/-\\'
.time_it
(bool, optional): Whether to time the execution of the code block. Defaults to False.time_it_live
(bool, optional): Whether to print the live execution time of the code block. Defaults to False.
Contributing
If you have any suggestions or improvements for pynimbar, feel free to submit a pull request or open an issue on the GitHub repository. We appreciate any feedback or contributions!
Example
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pynimbar-1.1.0.tar.gz
.
File metadata
- Download URL: pynimbar-1.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61cef8c8f6c08f48116dd45394affc913d42ad2a4836531f1ebaa4943d14ea7f |
|
MD5 | 6c91a9eb10027e034da0ba842c921e46 |
|
BLAKE2b-256 | a7837e3be8097522a1f95d3a472d893b1448a797dc11a70eceb38b9fd6490dc3 |
File details
Details for the file pynimbar-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: pynimbar-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33236fe9ed83bf3d16475865b7c9fb43f12477d9beacb8df604f6ca25d88ce2d |
|
MD5 | 13e50aa92500380fb13259cdc5baedaf |
|
BLAKE2b-256 | fb46bd37e57b67894ff56edad6cc1fdf7e26cc9a21314d8a9de6921cbd37c088 |