{"id":1861,"library":"proglog","title":"Progress Log Manager","description":"Proglog is a progress logging system for Python (current version 0.1.12). It enables developers to build complex libraries while offering users fine-grained control over logs, callbacks, and progress bars. It is actively maintained with releases focusing on build system improvements and documentation.","status":"active","version":"0.1.12","language":"en","source_language":"en","source_url":"https://github.com/Edinburgh-Genome-Fou/proglog","tags":["logging","progress-bar","console","notebook","web","developer-tool"],"install":[{"cmd":"pip install proglog","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Common entry point for obtaining a logger configured for console, notebook, or silent operation.","symbol":"default_bar_logger","correct":"from proglog import default_bar_logger"},{"note":"Used for integrating with the popular tqdm library for progress bars.","symbol":"TqdmProgressBarLogger","correct":"from proglog import TqdmProgressBarLogger"},{"note":"Globally configures proglog to use HTML progress bars in Jupyter/IPython notebooks.","symbol":"notebook","correct":"import proglog\nproglog.notebook()"}],"quickstart":{"code":"import time\nfrom proglog import default_bar_logger, TqdmProgressBarLogger\n\ndef my_processing_function(data_items=10, logger='bar'):\n    \"\"\"A function that simulates work and uses proglog for progress.\"\"\"\n    logger = default_bar_logger(logger) # Initialize logger based on input string or object\n    results = []\n    for i in logger.iter_bar(iterable=range(data_items), message=\"Processing data\"): # Use 'iterable' for cleaner iteration\n        # Simulate some computational work\n        time.sleep(0.05)\n        results.append(i * 2)\n    return results\n\nprint(\"--- Running with default console progress bar ---\")\nmy_processing_function(data_items=5)\n\nprint(\"\\n--- Running with TQDM progress bar (explicitly passed) ---\")\ntqdm_logger_instance = TqdmProgressBarLogger() # Create an instance of a specific logger\nmy_processing_function(data_items=7, logger=tqdm_logger_instance)\n\nprint(\"\\n--- Running with no progress bar ---\")\nmy_processing_function(data_items=3, logger=None)\n\n# To enable notebook specific bars, one would typically call proglog.notebook() once\n# at the start of a Jupyter notebook session, before calling functions that use proglog.\n# For example:\n# import proglog\n# proglog.notebook()\n# my_processing_function(data_items=5)","lang":"python","description":"This quickstart demonstrates how to integrate `proglog` into a function to manage progress bars. It shows usage with the default console bar, an explicit `TqdmProgressBarLogger`, and disabling the bar. For Jupyter notebooks, `proglog.notebook()` should be called once to activate HTML bars."},"warnings":[{"fix":"For fine-grained control, explicitly pass specific logger instances (e.g., `TqdmProgressBarLogger()` or a custom console logger) to functions instead of relying solely on the global `proglog.notebook()` effect or string shortcuts like `logger='bar'`.","message":"When using `proglog.notebook()` to enable HTML progress bars, this setting applies globally to the current Python process. If different parts of an application (e.g., a script vs. an interactive session within the same process) require different progress bar behaviors (console vs. HTML), this global state can lead to unexpected display modes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To prevent namespace collisions in nested progress bars, provide a unique `bar_prefix` argument to `logger.iter_bar()` calls within different libraries or components. For example, `logger.iter_bar(..., bar_prefix='my_library_')`.","message":"In complex applications with nested `iter_bar` calls across multiple libraries, progress bars might interfere with each other if they implicitly use the same internal identifiers. This can lead to incorrect or confusing progress displays, especially if loop variables or names are not unique.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}