# Py-Spin
[![Latest Version][1]][2]
[![Build Status][3]][4]
[![Python Versions][5]][2]
A little terminal spinner lib. Heavily inspired by [go-spin][].
## Demo
![pyspin_demo][]
## Install
$ pip install pyspin
## Usage
make a spinner by hand:
```python
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:
```python
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! :sparkles: :cake: :sparkles:
## License
MIT.
[1]: http://img.shields.io/pypi/v/pyspin.svg
[2]: https://pypi.python.org/pypi/pyspin
[go-spin]: https://github.com/tj/go-spin
[pyspin_demo]: https://cloud.githubusercontent.com/assets/5268051/7448038/ba152a8c-f241-11e4-86e0-50bc3b33bce5.gif
[3]: https://travis-ci.org/lord63/py-spin.svg
[4]: https://travis-ci.org/lord63/py-spin
[5]: https://img.shields.io/pypi/pyversions/pyspin.svg
[![Latest Version][1]][2]
[![Build Status][3]][4]
[![Python Versions][5]][2]
A little terminal spinner lib. Heavily inspired by [go-spin][].
## Demo
![pyspin_demo][]
## Install
$ pip install pyspin
## Usage
make a spinner by hand:
```python
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:
```python
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! :sparkles: :cake: :sparkles:
## License
MIT.
[1]: http://img.shields.io/pypi/v/pyspin.svg
[2]: https://pypi.python.org/pypi/pyspin
[go-spin]: https://github.com/tj/go-spin
[pyspin_demo]: https://cloud.githubusercontent.com/assets/5268051/7448038/ba152a8c-f241-11e4-86e0-50bc3b33bce5.gif
[3]: https://travis-ci.org/lord63/py-spin.svg
[4]: https://travis-ci.org/lord63/py-spin
[5]: https://img.shields.io/pypi/pyversions/pyspin.svg
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.1.0.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyspin-1.1.0.tar.gz.
File metadata
- Download URL: pyspin-1.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab968e65e54f2f50ac0adf3791b8d97dde47af5ce6f47456048db6565005e98e
|
|
| MD5 |
ea331f69380e928213f603afa30c14c7
|
|
| BLAKE2b-256 |
80985588f09d88b559d57592cc1cc0408784d69c7ea61f96d1b619103dbece6c
|
File details
Details for the file pyspin-1.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: pyspin-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35d7617e3b447413c319bb89e323477cf49aa916d8b792e2fba4bd30a7cf6ff6
|
|
| MD5 |
bc381a8fc8a0d342148dffe228e87787
|
|
| BLAKE2b-256 |
88ca95946fd8c87f63e8b25f4e5263ee22b4f385ab48e9c21241e03ad2a6631b
|