bolster.utils

Utility bits and pieces.

Random helpful functions that don’t fit anywhere else: - timed: decorator to time function execution - TqdmLoggingHandler: logging that plays nice with tqdm progress bars - web: resilient web scraping helpers - rss: RSS/Atom feed parsing utilities - dt: datetime utilities - io: file/data helpers - aws/azure: cloud platform helpers

Submodules

Attributes

logger

F

version_no

Classes

TqdmLoggingHandler

Custom logging handler that uses tqdm to display log messages.

Functions

timed(func)

This decorator prints the execution time for the decorated function.

Package Contents

bolster.utils.logger[source]
bolster.utils.F[source]
bolster.utils.version_no[source]
class bolster.utils.TqdmLoggingHandler(level=logging.NOTSET)[source]

Bases: logging.Handler

Custom logging handler that uses tqdm to display log messages.

Usage: logging.getLogger().addHandler(TqdmLoggingHandler()).

Initialize the handler with the specified logging level.

emit(record)[source]

Emit a log record using tqdm.write to avoid interfering with progress bars.

bolster.utils.timed(func)[source]

This decorator prints the execution time for the decorated function.