Package: apytl
Another Python Terminal LoggerHere it is: another python terminal logger---apytl.This implementation uses only the standard Python library and supports unicode
emojis. If you've ever wanted a progress bar that fills with piles of poop,
eggplants, or extended middle fingers, then you're in the right place.InstallationpipI've attempted to make this easy. You should be able to usepipto install the
package by running:pip install apytlRight now the package is only released for Python >=3.5. Ifpipcomplains
about not finding a version, you can either try upgrading Python, or build from
source.Building from sourceYou may install from source by either downloading the files from PyPI(here)or cloning the git repository:git clone https://github.com/anadolski/apytl.gitIf this is the first time you're installing the package, all you should need to
do iscdto the source directory (i.e., the one containingsetup.py) and
run:python setup.py buildpython setup.py install --user --record ./.installed_files.txtIf you re-clone the repo (orgit pullor otherwise update the source code),
you will need to reinstall to take advantage of all the fun new features. And
bugs. Let's not forget those bugs. To reinstall---again, from the source
directory---run:rm $(cat ./.installed_files.txt)(Note: This command will attempt to delete every entry in.installed_files.txt, so use with caution. Ensure there isn't anything
important hiding in that file.)To reinstall, simply run thebuildandinstallcommands mentioned at the
beginning of the section.UseYou can use the progress bar for iteration tracking. All the function needs to
know is the total number of iterations in the loop, and the iteration that it is
currently on. Just drop theapytl.Bar().drawbar()function inside your loop
and pass it those parameters. Here's a minimal example:importtimeimportapytltotal_iterations=25wait=0.1forindex,valueinenumerate(range(total_iterations)):# Your code goes here, then we draw the progress barapytl.Bar().drawbar(value,total_iterations)time.sleep(wait)But you probably want emojis, so do this instead:importtimeimportapytltotal_iterations=25wait=0.1forindex,valueinenumerate(range(total_iterations)):# Your code goes here, then we draw the progress barapytl.Bar().drawbar(value,total_iterations,fill='poop')time.sleep(wait)Ta-da! Poop all over your terminal (assuming the combination of your display
manager, terminal emulator, and font supports it).apytl.Bar().drawbar()accepts some customization options; see the docstring
for complete details. Here are a couple highlights:fill: takes arbitrary single-character alphanumeric input, or an arbitrary
Python-formatted unicode emoji (of the form\\UXXXXXXXXor\\uXXXX), or
one of a few preset options listed in the docstring.barsize: takes an integer and sets the size of the filling region.DevelopmentThis package is an alpha release and under active development. That means that I
fix bugs and create new ones approximately whenever I feel like it.Themasterbranch is the most stable version of the package, with primary
development happening ondev.Pull requests and issue tickets are both welcomed and encouraged. Please put
specific emoji requests into issue tickets (for now).