https://github.com/mokira3d48/pgit
PGIT allows you to put a progress bar in your Python program.
https://github.com/mokira3d48/pgit
progress-bar terminal-based
Last synced: about 2 months ago
JSON representation
PGIT allows you to put a progress bar in your Python program.
- Host: GitHub
- URL: https://github.com/mokira3d48/pgit
- Owner: mokira3d48
- License: mit
- Created: 2023-12-17T14:13:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-27T23:37:17.000Z (about 2 months ago)
- Last Synced: 2025-03-28T00:27:35.584Z (about 2 months ago)
- Topics: progress-bar, terminal-based
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Progress Iterator (PgIt)


## Installation
Just copy and past this module into your project source code.## Usage
```python
from pgit import PBM, ProgressBardef main():
"""Main function"""
pbm = PBM(" | ")
pb1 = ProgressBar()
pb2 = ProgressBar()
pb1.name = "progress1"
pb2.name = "progress2"
pbm.append(pb2)
pbm.add(pb1)pb1.length = 300
pb2.length = 5
pb1.bins = 100
pb2.bins = 5
pb2.bchr = '='
pb2.pchr = '>'
pb2.empt = '.'
pb2.lchr = '{'
pb2.rchr = '}'
pb2.format = "{logger} {progressbar} {percent}"
pb2.log_format("code: {k:05d} / {num}", k=0, num=pb1.length)for i in range(2):
for j in range(pb1.length):
pb1.step(1)
if j % 2 == 0:
pb2.step(1)
pb1.log(f"index: {j}")
pb2.log(k=j)
sleep(0.05)
if pb2.full():
pb2.reset()pbm.resume(
f"End of step {i} session in " + "{progress1_duration}.")
pbm.reset()pbm.resume(
"End of all progress session"
" in {progress1_duration} - {progress2_duration}.")
pbm.reset()if __name__ == '__main__':
main()
``````
End of step 0 session in 000:00:00:15.119.
End of step 1 session in 000:00:00:15.124.
End of all progress session in 000:00:00:15.124 - 000:00:00:00.000.
```