Metadata-Version: 2.1
Name: ProgressIter
Version: 0.1
Summary: A simple wrapper of any Iterator or Iterable
Home-page: https://github.com/pypa/sampleproject
Author: Bojack
Author-email: mayan2017@buaa.edu.cn
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# ProgressIter <kbd>v0.1</kbd>

Discription
-------------

This is a simple wrapper of any Iterator or Iterable and print the progressbar string during a for loop.

Like this:

    [#################################################8                                                  ]49%(5131/10289)some extra information

Usage
--------------

### Class instantiation

    Progressbar(
        iter
        length=0,
        on=True,
    )

<kbd>iter</kbd> is the Iterator or the Iterable object you want to iterate in a for loop.

<kbd>length</kbd> (Optional) The total length of iter. Only use if the iter object has no attribute \_\_len__. If the length was set wrong, the printing string of progressbar may act wrong.

<kbd>on</kbd> (Optional) If it is set to False, nothing will be print. The progressbar will act the same as the iterable object.

### Methods

    show_message(str)

<kbd>str</kbd> Some extra information you want to print after the string of progressbar. When this method is called, the information will not be print immediately. When the iterable object goes to the next step, this information will be print.

Example
--------------

    from Progressbar import Progressbar as PB
    import time

    def some_work(some_data):
        time.sleep(0.001)

    some_iterable_dataset = range(1000)

    start_time = time.time()
    pb = PB(some_iterable_dataset, on=True)
    for data in pb:
        some_work(data)
        pb.show_message('time:%.1f sec'%(time.time()-start_time))



