Name | pysnurr JSON |
Version |
0.4.0
JSON |
| download |
home_page | None |
Summary | A beautiful terminal spinner library for Python |
upload_time | 2024-12-29 22:43:05 |
maintainer | None |
docs_url | None |
author | dewe |
requires_python | >=3.10 |
license | None |
keywords |
cli
loading
progress
spinner
terminal
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pysnurr
[![Tests](https://github.com/dewe/pysnurr/actions/workflows/tests.yml/badge.svg)](https://github.com/dewe/pysnurr/actions/workflows/tests.yml)
A beautiful terminal spinner library for Python. Provides non-blocking spinner animations at the current cursor position.
## Installation
```bash
pip install pysnurr
```
## Usage
```python
from pysnurr import Snurr, SPINNERS
import time
# Basic usage with context manager (recommended)
with Snurr() as spinner:
time.sleep(2) # Do some work
# Traditional usage
spinner = Snurr()
spinner.start()
time.sleep(2) # Do some work
spinner.stop()
# Choose from various spinner styles
spinner = Snurr(symbols=SPINNERS["CLASSIC"]) # /-\|
spinner = Snurr(symbols=SPINNERS["EARTH"]) # 🌍🌎🌏
spinner = Snurr(symbols=SPINNERS["CLOCK"]) # 🕐🕑🕒...
spinner = Snurr(symbols=SPINNERS["HEARTS"]) # 💛💙💜💚
# Show spinner at end of line
print("Processing", end="")
with Snurr(append=True) as spinner: # Adds space before spinner
time.sleep(2)
print(" Done!")
# Thread-safe output during spinning
with Snurr(symbols=SPINNERS["EARTH"]) as spinner:
spinner.write("Starting a long process...")
time.sleep(1)
spinner.write("Step 1: Data processing")
time.sleep(1)
spinner.write("Step 2: Analysis complete")
```
## Features
- Non-blocking animation
- Multiple built-in spinner styles:
- `CLASSIC`: Classic ASCII spinner (/-\|)
- `DOTS`: Braille dots animation
- `BAR`: ASCII loading bar
- `EARTH`: Earth rotation (🌍🌎🌏)
- `MOON`: Moon phases
- `CLOCK`: Clock rotation
- `ARROWS`: Arrow rotation
- `DOTS_BOUNCE`: Bouncing dots
- `TRIANGLES`: Rotating triangles
- `HEARTS`: Colorful hearts
- Cursor hiding during animation
- Thread-safe output
- No external dependencies
- Flexible positioning (new line or end of text)
- Python 3.7+ support
## Development
Clone the repository and install in development mode:
```bash
git clone https://github.com/dewe/pysnurr.git
cd pysnurr
pip install -e .
```
Run tests:
```bash
pip install pytest
python -m pytest tests/
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "pysnurr",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "cli, loading, progress, spinner, terminal",
"author": "dewe",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/63/68/762dc1390e7887630cc7112cd8a5476892e814b5e9bdfd0b396fd0b8fd86/pysnurr-0.4.0.tar.gz",
"platform": null,
"description": "# pysnurr\n\n[![Tests](https://github.com/dewe/pysnurr/actions/workflows/tests.yml/badge.svg)](https://github.com/dewe/pysnurr/actions/workflows/tests.yml)\n\nA beautiful terminal spinner library for Python. Provides non-blocking spinner animations at the current cursor position.\n\n## Installation\n\n```bash\npip install pysnurr\n```\n\n## Usage\n\n```python\nfrom pysnurr import Snurr, SPINNERS\nimport time\n\n# Basic usage with context manager (recommended)\nwith Snurr() as spinner:\n time.sleep(2) # Do some work\n\n# Traditional usage\nspinner = Snurr()\nspinner.start()\ntime.sleep(2) # Do some work\nspinner.stop()\n\n# Choose from various spinner styles\nspinner = Snurr(symbols=SPINNERS[\"CLASSIC\"]) # /-\\|\nspinner = Snurr(symbols=SPINNERS[\"EARTH\"]) # \ud83c\udf0d\ud83c\udf0e\ud83c\udf0f\nspinner = Snurr(symbols=SPINNERS[\"CLOCK\"]) # \ud83d\udd50\ud83d\udd51\ud83d\udd52...\nspinner = Snurr(symbols=SPINNERS[\"HEARTS\"]) # \ud83d\udc9b\ud83d\udc99\ud83d\udc9c\ud83d\udc9a\n\n# Show spinner at end of line\nprint(\"Processing\", end=\"\")\nwith Snurr(append=True) as spinner: # Adds space before spinner\n time.sleep(2)\nprint(\" Done!\")\n\n# Thread-safe output during spinning\nwith Snurr(symbols=SPINNERS[\"EARTH\"]) as spinner:\n spinner.write(\"Starting a long process...\")\n time.sleep(1)\n spinner.write(\"Step 1: Data processing\")\n time.sleep(1)\n spinner.write(\"Step 2: Analysis complete\")\n```\n\n## Features\n\n- Non-blocking animation\n- Multiple built-in spinner styles:\n - `CLASSIC`: Classic ASCII spinner (/-\\|)\n - `DOTS`: Braille dots animation\n - `BAR`: ASCII loading bar\n - `EARTH`: Earth rotation (\ud83c\udf0d\ud83c\udf0e\ud83c\udf0f)\n - `MOON`: Moon phases\n - `CLOCK`: Clock rotation\n - `ARROWS`: Arrow rotation\n - `DOTS_BOUNCE`: Bouncing dots\n - `TRIANGLES`: Rotating triangles\n - `HEARTS`: Colorful hearts\n- Cursor hiding during animation\n- Thread-safe output\n- No external dependencies\n- Flexible positioning (new line or end of text)\n- Python 3.7+ support\n\n## Development\n\nClone the repository and install in development mode:\n\n```bash\ngit clone https://github.com/dewe/pysnurr.git\ncd pysnurr\npip install -e .\n```\n\nRun tests:\n\n```bash\npip install pytest\npython -m pytest tests/\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "A beautiful terminal spinner library for Python",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/dewe/pysnurr",
"Issues": "https://github.com/dewe/pysnurr/issues",
"Repository": "https://github.com/dewe/pysnurr"
},
"split_keywords": [
"cli",
" loading",
" progress",
" spinner",
" terminal"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2bada5bd3b32bb464c76e40dc860de9cf020896dda1d2cfb3171be0a650bc6aa",
"md5": "e6ec54dfe96c466f85d2c2908b1cbfb7",
"sha256": "ea9fe9f599e1369441b7d68473226abe3dda3c105f5600a4f6cd5a1b34367ddd"
},
"downloads": -1,
"filename": "pysnurr-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e6ec54dfe96c466f85d2c2908b1cbfb7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 5961,
"upload_time": "2024-12-29T22:43:03",
"upload_time_iso_8601": "2024-12-29T22:43:03.273992Z",
"url": "https://files.pythonhosted.org/packages/2b/ad/a5bd3b32bb464c76e40dc860de9cf020896dda1d2cfb3171be0a650bc6aa/pysnurr-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6368762dc1390e7887630cc7112cd8a5476892e814b5e9bdfd0b396fd0b8fd86",
"md5": "678fe0621fe4cc9bd5b528769ed83ca2",
"sha256": "ff4cf2a96c663b169bee426d3dc521f2e2f27eba38daeb48492fe7ea77141047"
},
"downloads": -1,
"filename": "pysnurr-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "678fe0621fe4cc9bd5b528769ed83ca2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 8807,
"upload_time": "2024-12-29T22:43:05",
"upload_time_iso_8601": "2024-12-29T22:43:05.222148Z",
"url": "https://files.pythonhosted.org/packages/63/68/762dc1390e7887630cc7112cd8a5476892e814b5e9bdfd0b396fd0b8fd86/pysnurr-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-29 22:43:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dewe",
"github_project": "pysnurr",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pysnurr"
}