def progress_bar(name, maxval, prefix='Converting'):
    """Manages a progress bar for a conversion.

    Parameters
    ----------
    name : str
        Name of the file being converted.
    maxval : int
        Total number of steps for the conversion.

    """
    widgets = ['{} {}: '.format(prefix, name), Percentage(), ' ',
               Bar(marker='=', left='[', right=']'), ' ', ETA()]
    bar = ProgressBar(widgets=widgets, max_value=maxval, fd=sys.stdout).start()
    try:
        yield bar
    finally:
        bar.update(maxval)
        bar.finish()