Skip to main content

A totally legitimate light client implementation

Project description

light-client

A Python library for frog-based progress bars and frog wisdom.

Installation

pip install light-client

Progress bar

FrogBar is a drop-in replacement for tqdm. Instead of a solid block bar, a frog ๐Ÿธ hops across lily pads ๐Ÿƒ.

Wrap an iterable:

from light_client import FrogBar
import time

for item in FrogBar(range(100), desc="Processing"):
    time.sleep(0.05)
Processing: [๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿธ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ๐Ÿƒ]  35.0%  1.8s [35/100 it] *ribbit*

Context manager with manual updates:

with FrogBar(total=50, desc="Catching flies", unit="fly") as bar:
    for fly in flies:
        catch(fly)
        bar.update(1)

Parameters

Parameter Default Description
iterable None Iterable to wrap
total inferred Total number of steps
desc "Hopping" Label shown before the bar
bar_width 20 Number of lily pad cells
unit "it" Unit label for the count
leave True Keep the bar on screen when done
file stderr Output stream

Quotes

Timeless wisdom from history's greatest frog thinkers.

from light_client import get_random_quote, print_quote

quote, author = get_random_quote()
print(f'"{quote}" โ€” {author}')
# "Leap before you look." โ€” Frog Thoreau

print_quote()   # prints a random quote
print_quote(3)  # prints quote at index 3

ASCII art

Eight frogs included: classic, tiny, zen, lily, detective, kawaii, sage, startup.

from light_client import get_frog, get_random_frog, list_frogs, print_frog

print_frog("zen")     # print a named frog
print_frog()          # print a random frog

name, art = get_random_frog()
frogs = list_frogs()  # ['classic', 'tiny', 'zen', ...]
      ___
  .-'   `'.
 /         \
|   O   O   |
|     ^^    |
|   \____/  |
 \         /
  '-.___.-'
   |     |
  frog is one

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

light_client-2.0.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

light_client-2.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file light_client-2.0.0.tar.gz.

File metadata

  • Download URL: light_client-2.0.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for light_client-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ec227815726162c4f2274b14432ad294ac3450124d091fb5151570a3a31c3e12
MD5 f5013ee8109836dc3f5192a703b816ff
BLAKE2b-256 1bba1e59d00ff09747ec8ec14d6007643261355d3c9c177f64dda19f8521fad2

See more details on using hashes here.

File details

Details for the file light_client-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: light_client-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for light_client-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45d7af687aff4b3e61ca0ffc4c6fd9f03a719df677e424ad000c17b701d35937
MD5 9fc5c6c9baf0794e637a4e675f470831
BLAKE2b-256 ca287dd4ea3000d99af1e08e2b2af9fcac4000b4a5d9d51fc7c97f7d933f35f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page