An open API service indexing awesome lists of open source software.

https://github.com/claytonpassmore/progress

A simple progress bar library for Python 3
https://github.com/claytonpassmore/progress

commandline-interface progress-bar python3

Last synced: 2 months ago
JSON representation

A simple progress bar library for Python 3

Awesome Lists containing this project

README

          

# Progress

A simple command line progress bar library for Python 3.

## Installation

Just use pip!

```bash
git clone git@github.com:ClaytonPassmore/progress.git
pip install ./progress
```

## Usage

Track progress while looping over a range.

```python
from progress import progress_range

for i in progress_range(10, -2, -2):
process(i)
```

```
83.3% [################################## ]
```

Track progress while looping over an iterable object.

```python
from glob import glob
from progress import progress_bar

filenames = glob('*')

for filename in progress_bar(filenames):
process(filename)
```

```
66.7% [########################### ]
```

Track progress while looping over a stream of undefined length.

```python
from progress import progress_counter

file_descriptor = open('file.txt', 'r')

for line in progress_counter(file_descriptor):
process(line)
```

```
Processed: 66/Unknown [ ###### ]
```

Manually track progress without an iterable object.

```python
from progress import manual_progress_counter

progress = manual_progress_counter()

while(True):
process()
progress.tick()
```

```
Processed: 6 [ ######### ]
```