• Stars
    star
    182
  • Rank 211,154 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terminal spinner package for Python. (This library is not the one from FLIR)

Py-Spin

A little terminal spinner lib. Heavily inspired by go-spin. (This library is not the one from FLIR).

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

import time

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! 🍰

License

MIT.

More Repositories

1

awesome-python-decorator

A curated list of awesome python decorator resources.
733
star
2

tldr.py

A python client for tldr: simplified and community-driven man pages.
Python
186
star
3

pyhipku

Encode any IP address as a haiku, funny and lovely. TRY IT NOW: http://pyhipku.lord63.com
Python
91
star
4

choosealicense-cli

Bring http://choosealicense.com to your terminal
Python
72
star
5

isitup

Check whether a website is up or down.
Python
65
star
6

v2ex_daily_mission

V2EX 签到 python 版本实现。支持签到,查询连续登录天数,查询签到日志。
Python
42
star
7

licen

Generate your license. Yet another lice, but implement with Jinja2 and docopt.
Groff
38
star
8

pyemojify

Substitutes emoji aliases to emoji raw characters. Simple but sweet 😄
Python
35
star
9

wonderful_bing

Set bing's picture as wallpaper, support cinnamon, gnome, xfce, mate.
Python
22
star
10

wangyi_music_top100

网易云音乐歌单 TOP 100 . Try it now:
Python
15
star
11

me-api

An extensible, personal API with custom integrations. It's a python port.
Python
15
star
12

ascii_art

Draw ascii art(bar, chart, histogram) in your terminal.
Python
11
star
13

a_bunch_of_code

A bunch of code that I wrote before.
Python
9
star
14

zimuzu

字幕组 (http://www.zimuzu.tv) python 版本命令行签到工具.
Python
8
star
15

caniuse

Can I use this name for my python package on PyPI ?
Python
7
star
16

five.py

Gives you five, funny and lovely.
Python
6
star
17

figlet_web

Generate text to ASCII art! TRY IT NOW: http://text2ascii.lord63.com/
JavaScript
5
star
18

rb_colors

Yet another ruby library that deals with colors.
Ruby
1
star
19

zhihudaily

又一个知乎日报的网页版... https://zhihudaily.lord63.com
CSS
1
star