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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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