py_tools_ds.processing package

Submodules

py_tools_ds.processing.progress_mon module

class py_tools_ds.processing.progress_mon.ProgressBar(prefix='', suffix='Complete', decimals=1, barLength=50, show_elapsed=True, timeout=None, use_as_callback=False, out=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>)[source]

Bases: object

print_progress(percent)[source]

Print progress.

Parameters

percent – <float> a number between 0 and 100

Returns

class py_tools_ds.processing.progress_mon.Timer(timeout=None, use_as_callback=False)[source]

Bases: object

property elapsed
property timed_out
py_tools_ds.processing.progress_mon.printPercentage(i, i_total)[source]

Print a percentage counter from within a loop.

Example: for i in range(100+1):

time.sleep(0.1) printPercentage(i)

Parameters
  • i

  • i_total

Returns

http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console

py_tools_ds.processing.progress_mon.tqdm_hook(t)[source]

Wraps tqdm instance. Don’t forget to close() or __exit__() the tqdm instance once you’re done with it (easiest using with syntax).

> with tqdm(…) as t: … reporthook = my_hook(t) … urllib.urlretrieve(…, reporthook=reporthook)

http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console

py_tools_ds.processing.shell module

py_tools_ds.processing.shell.subcall_with_output(cmd, v=False)[source]

Execute external command and get its stdout, exitcode and stderr.

Parameters
  • cmd – a normal shell command including parameters

  • v – verbose mode (prints

Module contents