https://github.com/xyzpw/dashbar
A progress-bar designed to be useful and easy to use.
https://github.com/xyzpw/dashbar
loading-spinner pip-package progress-bar
Last synced: 6 months ago
JSON representation
A progress-bar designed to be useful and easy to use.
- Host: GitHub
- URL: https://github.com/xyzpw/dashbar
- Owner: xyzpw
- License: mit
- Created: 2024-02-23T07:04:57.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T10:20:13.000Z (about 2 years ago)
- Last Synced: 2025-09-18T17:11:37.279Z (9 months ago)
- Topics: loading-spinner, pip-package, progress-bar
- Language: Python
- Homepage: https://pypi.org/project/dashbar/
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dashbar



A progress-bar designed to be useful and easy to use.

## Usage
### Iterating
To start dashbar, execute the following code:
```python
for i in dashbar.dash(10, dash_type="pipe", desc="example"):
time.sleep(1/10) #completion after one second
if i == 5:
dashbar.status("half-way complete")
```
If the progress is large, the `autodash` function can be used, which adjusts the step count to fit the terminal:
```python
for i in dashbar.autodash(10):
time.sleep(1/10)
if i == 8:
dashbar.log("eighty percent complete")
```
### Customizing dashbar
Dashbars can be customized with the following code:
```python
dashbar.customize(element="filler", value=" ")
```
List of dashbars:
- classic
- arrow
- box
- circle_charger
- box_charger
- striped
- dollar
- box_shade
- pipe
- heart
- radioactive
- benzene
- custom
List of dashbar elements:
- start
- head
- trail
- filler
- finish
### Building a Dashbar
Dashbars can be built via the `Dashbar` class:
```python
bar = dashbar.Dashbar(10, "box_shade")
for i in range(100):
if i%10 == 0:
bar.update(1, display=True)
time.sleep(1/20) #completion after five seconds
```