SIL
SIL (Status In-Line) is a simple progress bar that provides sufficient
flexibility and compatibility with the multiprocessing library.
Basic Usage
from sil import Sil
status = Sil(
total=200, # what is the number you are counting to
length=40, # how many characters should be use to print the progress bar
every=10, # after how many elements should the progress bar update (e.g. throttling)
indicator='*' # what character should be used in the progress bar
)
for i, el in elements:
status.tick()
Multiprocessing example
It can be useful to see the progress of you code when parallelized
from sil import Sil
from multiprocessing import Pool, Value
# global shared memory counter
_i = Value('i', -1, lock=True)
def mp_tick(i, status):
# do something for current element in parallel
with _i.get_lock():
_i.value += 1
status.update(_i.value)
with Pool(processes=4) as pool:
pool.starmap(mp_tick, [(i, status) for i in range(200)])
Metadata
Release files for sil 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sil-0.1.6.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sil-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / sil-0.1.6.tar.gz
| Download URL | sil-0.1.6.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a52c3aadc07a7045e9049ff8cb3b055968fbb1b2b0ffe616db07dd82860be5d
|
|
BLAKE2b-256 checksum How to use checksums |
b6215c8a059fc055528ebec7bb5d4cb69c4dc2d4c916dee09a52d02071ecb514
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8
|
Release files / sil-0.1.6-py3-none-any.whl
| Download URL | sil-0.1.6-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43e2a6f990fe870285cace5a5e05503421e8f808fbfcfaba02132defd6a14a31
|
|
BLAKE2b-256 checksum How to use checksums |
b3fed38748c27654ca816c45e3057ff490c4fa460b2f092dd60ce66374deaf0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8
|