# 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/ec/9b/856cdc400984c094a508ea8933d04b58dd1f9ad2998e533065122edb3ea4/loadspinner-0.5.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.5",
"project_urls": {
"Homepage": "https://github.com/xyzpw/loadspinner/"
},
"split_keywords": [
"loading",
" loader",
" progress",
" throbber",
" spinner"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21d525e47be525fa0e1882c06d9975e275d9d46c1fe79efc4978d7dea7a0d7ff",
"md5": "7ff7b482dcba9e4f7d5c56249de4f282",
"sha256": "ea35883aa87c0048afd1df69de044aa20fcd6d6562c8399133c8885ded45ab9f"
},
"downloads": -1,
"filename": "loadspinner-0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ff7b482dcba9e4f7d5c56249de4f282",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6200,
"upload_time": "2024-05-18T05:01:11",
"upload_time_iso_8601": "2024-05-18T05:01:11.962745Z",
"url": "https://files.pythonhosted.org/packages/21/d5/25e47be525fa0e1882c06d9975e275d9d46c1fe79efc4978d7dea7a0d7ff/loadspinner-0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec9b856cdc400984c094a508ea8933d04b58dd1f9ad2998e533065122edb3ea4",
"md5": "0c51292c81ead0b60afa7f8e305d06d3",
"sha256": "198af1dc30b64c53797b5095c21dd7158598ad577fb00870ab82a86db8d84997"
},
"downloads": -1,
"filename": "loadspinner-0.5.tar.gz",
"has_sig": false,
"md5_digest": "0c51292c81ead0b60afa7f8e305d06d3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5429,
"upload_time": "2024-05-18T05:01:13",
"upload_time_iso_8601": "2024-05-18T05:01:13.803864Z",
"url": "https://files.pythonhosted.org/packages/ec/9b/856cdc400984c094a508ea8933d04b58dd1f9ad2998e533065122edb3ea4/loadspinner-0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-18 05:01:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "xyzpw",
"github_project": "loadspinner",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "loadspinner"
}