# tiny_progress_bar
Progress Bar for Python 3. Does not use any external libraries and the code is very very tiny.
![Example gif](./example.gif)
# Installation
Simply use `pip`!
`pip install tiny-progress-bar`
https://pypi.org/project/tiny-progress-bar/
# How to use
Import the `progress_bar` function into your script.
Then wrap any iterable with it. Then you'll see it running.
### Example:
```
from tiny_progress_bar import progress_bar as pb
from time import sleep
array = range(10)
counter = 0
for i in pb(array):
sleep(0.1) # Your long running process
counter += i
print(sum(array) == counter)
```
## Bar Length
You can also specify the length of the progress bar by changing the `bar_length` parameter.
Note the minimum `bar_length` is 10.
### Smaller Bar Example
```
# Smaller bar
length = 10
array = range(100)
for _ in pb(array, bar_length=length):
sleep(0.1) # Your long running process
```
### Larger Bar Example
```
# Larger bar
length = 100
array = range(100)
for _ in pb(array, bar_length=length):
sleep(0.1) # Your long running process
```
# Testing
A test file is included in this package.
Feel free to run `pytest` or `pytest test_tiny_progress_bar.py`
Raw data
{
"_id": null,
"home_page": "https://github.com/aklin2/tiny_progress_bar",
"name": "tiny-progress-bar",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "progress, progress bar, tiny_progress_bar, loading, loading bar, loading_bar",
"author": "Alan Lin",
"author_email": "lin.alan.k@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/29/b1/31b80a2570a3fa48e46495452acef1a48af62099ee0c8752ea178a2876b3/tiny_progress_bar-0.1.6.tar.gz",
"platform": null,
"description": "# tiny_progress_bar\n\nProgress Bar for Python 3. Does not use any external libraries and the code is very very tiny.\n\n![Example gif](./example.gif)\n\n# Installation\n\nSimply use `pip`!\n\n`pip install tiny-progress-bar`\n\nhttps://pypi.org/project/tiny-progress-bar/\n\n# How to use\n\nImport the `progress_bar` function into your script.\n\nThen wrap any iterable with it. Then you'll see it running.\n\n### Example:\n\n```\nfrom tiny_progress_bar import progress_bar as pb\nfrom time import sleep\n\narray = range(10)\ncounter = 0\n\nfor i in pb(array):\n sleep(0.1) # Your long running process\n counter += i\n\nprint(sum(array) == counter)\n```\n\n## Bar Length\n\nYou can also specify the length of the progress bar by changing the `bar_length` parameter.\n\nNote the minimum `bar_length` is 10.\n\n### Smaller Bar Example\n\n```\n# Smaller bar\nlength = 10\narray = range(100)\nfor _ in pb(array, bar_length=length):\n sleep(0.1) # Your long running process\n```\n\n### Larger Bar Example\n\n```\n# Larger bar\nlength = 100\narray = range(100)\nfor _ in pb(array, bar_length=length):\n sleep(0.1) # Your long running process\n```\n\n# Testing\n\nA test file is included in this package.\n\nFeel free to run `pytest` or `pytest test_tiny_progress_bar.py`\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "Simple progress bar for Python 3",
"version": "0.1.6",
"project_urls": {
"Download": "https://github.com/aklin2/tiny_progress_bar/archive/refs/tags/v0.1.5.tar.gz",
"Homepage": "https://github.com/aklin2/tiny_progress_bar"
},
"split_keywords": [
"progress",
" progress bar",
" tiny_progress_bar",
" loading",
" loading bar",
" loading_bar"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5a62fb45e3fdeb4957b0adbe726f345f603cb08775a9a6100a131e28fc445816",
"md5": "66bfff5cedcfa458da6c2e0843a5b678",
"sha256": "5a548af9d51a6e725f60a9e61bb12c9d514ae50b46e53c0d70e0b54603f7f28d"
},
"downloads": -1,
"filename": "tiny_progress_bar-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "66bfff5cedcfa458da6c2e0843a5b678",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 15474,
"upload_time": "2024-06-06T21:17:49",
"upload_time_iso_8601": "2024-06-06T21:17:49.623676Z",
"url": "https://files.pythonhosted.org/packages/5a/62/fb45e3fdeb4957b0adbe726f345f603cb08775a9a6100a131e28fc445816/tiny_progress_bar-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "29b131b80a2570a3fa48e46495452acef1a48af62099ee0c8752ea178a2876b3",
"md5": "19c2b89fea776142481c6dc1d9d80286",
"sha256": "6795b013b83dc057ed56af7d593bc647c1b4254388f6eda3dfc3b49da99c8936"
},
"downloads": -1,
"filename": "tiny_progress_bar-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "19c2b89fea776142481c6dc1d9d80286",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16106,
"upload_time": "2024-06-06T21:17:50",
"upload_time_iso_8601": "2024-06-06T21:17:50.747900Z",
"url": "https://files.pythonhosted.org/packages/29/b1/31b80a2570a3fa48e46495452acef1a48af62099ee0c8752ea178a2876b3/tiny_progress_bar-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-06 21:17:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aklin2",
"github_project": "tiny_progress_bar",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tiny-progress-bar"
}