Skip to main content

Latest Version Build Status Python Versions

A little terminal spinner lib. Heavily inspired by go-spin.

Demo

pyspin\_demo

pyspin_demo

Install

$ pip install pyspin

Usage

make a spinner by hand:

from __future__ import print_function

import sys
import time

from pyspin.spin import Default, Spinner

# Choose a spin style.
spin = Spinner(Default)
# Spin it now.
for i in range(50):
    print(u"\r{0}".format(spin.next()), end="")
    sys.stdout.flush()
    time.sleep(0.1)

or you can use the decorator pyspin provide:

from __future__ import print_function

from pyspin.spin import make_spin, Default

# Choose a spin style and the words when showing the spin.
@make_spin(Default, "Downloading...")
def download_video():
    time.sleep(10)

if __name__ == '__main__':
    print("I'm going to download a video, and it'll cost much time.")
    download_video()
    print("Done!")

You can have a look at the example code in the example folder. Run it via:

$ python example/example_spin.py
$ python example/usage_example.py

Contribute

  • If you find an interesting spinner, send me a pull request <3

  • If you find a bug or have any suggestions, open an issue.

Contributions are always welcome at any time! :sparkles: :cake: :sparkles:

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyspin-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

pyspin-1.0.0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyspin-1.0.0.tar.gz.

File metadata

  • Download URL: pyspin-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyspin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 11a76587c706400a03e9ceb2615e656f80eb17084a5d560b25a30be6309a00b4
MD5 cb8e466de318477518e7c939d8390ab7
BLAKE2b-256 426717cd99a84e85cf092e5c054ca1d7b55c1649140f96722c0166fde7c79d86

See more details on using hashes here.

File details

Details for the file pyspin-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyspin-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a101bb44e87468b624f7aa85b91e8d11d10484df358a0e8279e9e9aefb017b4f
MD5 a73c1cbf3acd2115bbdbb0bf5552b17e
BLAKE2b-256 41ecbfbaad89b6d2622f44175bba5ebaaba54c54da2fad5f69f981d7ad2a49f3

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