# loadspinner
![Pepy Total Downlods](https://img.shields.io/pepy/dt/loadspinner)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/loadspinner)
![GitHub repo size](https://img.shields.io/github/repo-size/xyzpw/loadspinner)
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:
```python
import loadspinner
spinner = loadspinner.Spinner(spinner_type="classic")
```
Starting the spinner:
```python
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:
```python
import loadspinner
with loadspinner.Spinner("newton"):
input("press enter to stop ")
```
Usage with decorators:
```python
from loadspinner import functionSpinner
@functionSpinner("building")
def doWork():
# code...
doWork()
```
Spinners can be made or customized:
```python
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")`
Raw data
{
"_id": null,
"home_page": "https://github.com/xyzpw/loadspinner/",
"name": "loadspinner",
"maintainer": "xyzpw",
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "loading, loader, progress, throbber, spinner",
"author": "xyzpw",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d7/7a/22c0a36a9bf01d38a39c57b58f39978e96fab29b9a2dabecb51c97b3beec/loadspinner-0.6.tar.gz",
"platform": null,
"description": "# loadspinner\n![Pepy Total Downlods](https://img.shields.io/pepy/dt/loadspinner)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/loadspinner)\n![GitHub repo size](https://img.shields.io/github/repo-size/xyzpw/loadspinner)\n\nA CLI based loading spinner which is used to tell the user work is being done in the background.\n\n**Loadspinner** contains more than 20 spinners to choose from, and you can even create your own spinner.\n\n## Prerequisites\n- Terminal that accepts ANSI codes\n\n## Usage\nCreating a spinner:\n```python\nimport loadspinner\nspinner = loadspinner.Spinner(spinner_type=\"classic\")\n```\n\nStarting the spinner:\n```python\nspinner.start() # starts the spinner\nspinner.stop() # stops the spinner\n```\n\n> [!HINT]\n> You can also assign a timer to spinners, e.g. `spinner.start(5)` will stop the spinner after 5 seconds.\n\nUsage with context managers:\n```python\nimport loadspinner\nwith loadspinner.Spinner(\"newton\"):\n input(\"press enter to stop \")\n```\n\nUsage with decorators:\n```python\nfrom loadspinner import functionSpinner\n@functionSpinner(\"building\")\ndef doWork():\n # code...\ndoWork()\n```\n\nSpinners can be made or customized:\n```python\nimport loadspinner\nloadspinner.makeSpinner(\n name=\"myCustomSpinner\",\n frames=[\"a\", \"b\", \"c\", \"1\", \"2\", \"3\"],\n interval=200,\n)\n```\nThe above code will create its own spinner which can be accessed as its own name, e.g. `loadspinner.Spinner(\"myCustomSpinner\")`\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "a CLI based loading spinner.",
"version": "0.6",
"project_urls": {
"Homepage": "https://github.com/xyzpw/loadspinner/"
},
"split_keywords": [
"loading",
" loader",
" progress",
" throbber",
" spinner"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "209141befec182ffad82ca53848bb09e66e721b20c293b2590c90f78d383cdbd",
"md5": "656c1df04ac8af6368115805ff1ac0f7",
"sha256": "882fa55183df3b5afbe96b04dff724c9f4d2795199ba8dd2cb7cfa93e9f3a03b"
},
"downloads": -1,
"filename": "loadspinner-0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "656c1df04ac8af6368115805ff1ac0f7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6216,
"upload_time": "2024-06-01T10:32:40",
"upload_time_iso_8601": "2024-06-01T10:32:40.663375Z",
"url": "https://files.pythonhosted.org/packages/20/91/41befec182ffad82ca53848bb09e66e721b20c293b2590c90f78d383cdbd/loadspinner-0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d77a22c0a36a9bf01d38a39c57b58f39978e96fab29b9a2dabecb51c97b3beec",
"md5": "ed7961a12e3819ddbf204b44227008f7",
"sha256": "add72f1fd5016900bc69acbe0079c9ff328953a1f6080a567afd01ac679ac6f7"
},
"downloads": -1,
"filename": "loadspinner-0.6.tar.gz",
"has_sig": false,
"md5_digest": "ed7961a12e3819ddbf204b44227008f7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5429,
"upload_time": "2024-06-01T10:32:42",
"upload_time_iso_8601": "2024-06-01T10:32:42.321516Z",
"url": "https://files.pythonhosted.org/packages/d7/7a/22c0a36a9bf01d38a39c57b58f39978e96fab29b9a2dabecb51c97b3beec/loadspinner-0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-01 10:32:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xyzpw",
"github_project": "loadspinner",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "loadspinner"
}