Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Build Status codecov

Another Python Terminal Logger

Here 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.

Installation

pip

I've attempted to make this easy. You should be able to use pip to install the package by running:

pip install apytl

Right now the package is only released for Python >=3.5. If pip complains about not finding a version, you can either try upgrading Python, or build from source.

Building from source

You may install from source by either downloading the files from PyPI (here) or cloning the git repository:

git clone https://github.com/anadolski/apytl.git

If this is the first time you're installing the package, all you should need to do is cd to the source directory (i.e., the one containing setup.py) and run:

python setup.py build
python setup.py install --user --record ./.installed_files.txt

If you re-clone the repo (or git pull or 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 the build and install commands mentioned at the beginning of the section.

Use

You 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 the apytl.Bar().drawbar() function inside your loop and pass it those parameters. Here's a minimal example:

import time
import apytl

total_iterations = 25
wait = 0.1

for index, value in enumerate(range(total_iterations)):
    # Your code goes here, then we draw the progress bar
    apytl.Bar().drawbar(value, total_iterations)
    time.sleep(wait)

But you probably want emojis, so do this instead:

import time
import apytl

total_iterations = 25
wait = 0.1

for index, value in enumerate(range(total_iterations)):
    # Your code goes here, then we draw the progress bar
    apytl.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 \\UXXXXXXXX or \\uXXXX), or one of a few preset options listed in the docstring.
  • barsize: takes an integer and sets the size of the filling region.

Development

This 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.

The master branch is the most stable version of the package, with primary development happening on dev.

Pull requests and issue tickets are both welcomed and encouraged. Please put specific emoji requests into issue tickets (for now).

Metadata

Release files for apytl 0.0a7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apytl 0.0a7
File Size Uploaded Provenance Actions
apytl-0.0a7.tar.gz 5.6 kB Without provenance Details for apytl-0.0a7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apytl 0.0a7
File Interpreter ABI Platform Actions
apytl-0.0a7-py3-none-any.whl Python 3 none any Details for apytl-0.0a7-py3-none-any.whl

Total release size: 12.4 kB

Release files / apytl-0.0a7.tar.gz

Download URL apytl-0.0a7.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b7dec277042032bd48b03d6f861a4aa6b925e65ca49547611f1ab96f58464a96
BLAKE2b-256 checksum
How to use checksums
16546a7052567b589260b01caa4fc22f156071af48a24652585002f29fd70fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release files / apytl-0.0a7-py3-none-any.whl

Download URL apytl-0.0a7-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
627dc9a72e6e5ecc884a33725305573038cd0a59d33e4989c571314d86970215
BLAKE2b-256 checksum
How to use checksums
e69df2584a14234ee75757e5dff7ff644621264b995f9527771abc2d77e80201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Security for apytl 0.0a7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page