Skip to main content

a CLI based loading spinner.

Project description

loadspinner

Pepy Total Downlods PyPI - Python Version GitHub repo size

A CLI based loading spinner which is used to tell the user work is being done in the background.

Loadspinner contains more than 20 spinners to choose from, and you can even create your own spinner.

Prerequisites

  • Terminal that accepts ANSI codes

Usage

Creating a spinner:

import loadspinner
spinner = loadspinner.Spinner(spinner_type="classic")

Starting the spinner:

spinner.start() # starts the spinner
spinner.stop() # stops the spinner

[!HINT] You can also assign a timer to spinners, e.g. spinner.start(5) will stop the spinner after 5 seconds.

Usage with context managers:

import loadspinner
with loadspinner.Spinner("newton"):
    input("press enter to stop ")

Usage with decorators:

from loadspinner import functionSpinner
@functionSpinner("building")
def doWork():
    # code...
doWork()

Spinners can be made or customized:

import loadspinner
loadspinner.makeSpinner(
    name="myCustomSpinner",
    frames=["a", "b", "c", "1", "2", "3"],
    interval=200,
)

The above code will create its own spinner which can be accessed as its own name, e.g. loadspinner.Spinner("myCustomSpinner")

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

loadspinner-0.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

loadspinner-0.5-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file loadspinner-0.5.tar.gz.

File metadata

  • Download URL: loadspinner-0.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for loadspinner-0.5.tar.gz
Algorithm Hash digest
SHA256 198af1dc30b64c53797b5095c21dd7158598ad577fb00870ab82a86db8d84997
MD5 0c51292c81ead0b60afa7f8e305d06d3
BLAKE2b-256 ec9b856cdc400984c094a508ea8933d04b58dd1f9ad2998e533065122edb3ea4

See more details on using hashes here.

File details

Details for the file loadspinner-0.5-py3-none-any.whl.

File metadata

  • Download URL: loadspinner-0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for loadspinner-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ea35883aa87c0048afd1df69de044aa20fcd6d6562c8399133c8885ded45ab9f
MD5 7ff7b482dcba9e4f7d5c56249de4f282
BLAKE2b-256 21d525e47be525fa0e1882c06d9975e275d9d46c1fe79efc4978d7dea7a0d7ff

See more details on using hashes here.

Supported by

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