{"id":5082,"library":"tqdm-loggable","title":"tqdm-loggable","description":"tqdm-loggable is a petite Python package (current version 0.4.1) that provides logging-friendly TQDM progress bars. It automatically converts standard tqdm progress bars into periodic log messages when running in non-interactive or headless environments (e.g., Docker, CI/CD, background workers), ensuring that progress is visible in logs rather than being hidden by a lack of a TTY. This prevents applications from appearing frozen during long-running tqdm operations by sending regular progress reports to the configured logging backend. The project has low activity on GitHub, suggesting an infrequent release cadence.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/tradingstrategy-ai/tqdm-loggable","tags":["tqdm","logging","progress-bar","headless","monitoring","ci/cd","docker"],"install":[{"cmd":"pip install tqdm-loggable","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core functionality is built on top of tqdm.","package":"tqdm","optional":false}],"imports":[{"note":"To leverage tqdm-loggable's features, you must import its `tqdm` wrapper instead of the original `tqdm.auto.tqdm` or `tqdm.tqdm`.","wrong":"from tqdm.auto import tqdm","symbol":"tqdm","correct":"from tqdm_loggable.auto import tqdm"},{"note":"Provides utilities for configuring tqdm-loggable's logging behavior, such as setting the log level and rate.","symbol":"tqdm_logging","correct":"from tqdm_loggable.tqdm_logging import tqdm_logging"}],"quickstart":{"code":"import datetime\nimport logging\nimport time\nimport os\nfrom tqdm_loggable.auto import tqdm\nfrom tqdm_loggable.tqdm_logging import tqdm_logging\n\n# Configure basic logging\nlogger = logging.getLogger()\nlogger.setLevel(logging.INFO)\nformatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')\nhandler = logging.StreamHandler()\nhandler.setFormatter(formatter)\nlogger.addHandler(handler)\n\n# Optional: Set tqdm-loggable's log level and update rate\ntqdm_logging.set_level(logging.INFO)\ntqdm_logging.set_log_rate(datetime.timedelta(seconds=2))\n\n# You can force logging mode by setting an environment variable:\n# os.environ['TQDM_LOGGABLE_FORCE'] = 'logging' # Forcing log output\n# os.environ['TQDM_LOGGABLE_FORCE'] = 'stdout'  # Forcing console bar\n# os.environ['TQDM_LOGGABLE_FORCE'] = 'auto'   # Restore auto-detection\n\nprint(\"Starting a simulated task...\")\nfor i in tqdm(range(20), desc=\"Processing items\", unit=\"item\"):\n    time.sleep(0.5)\n    if i == 5:\n        logger.info(\"Mid-task progress report\")\n\nprint(\"Task completed.\")\n","lang":"python","description":"This quickstart demonstrates how to integrate `tqdm-loggable`. It configures standard Python logging, then uses `tqdm_loggable.auto.tqdm` to wrap an iterable. In an interactive terminal, this will show a normal progress bar. When run in a headless environment, or if `TQDM_LOGGABLE_FORCE=logging` is set, it will emit periodic log messages instead of an interactive bar, like 'Progress on: Processing items 10/20 rate:X it/s remaining:Y elapsed:Z'. The `set_log_rate` controls how frequently these log messages appear."},"warnings":[{"fix":"Ensure you understand the distinct use cases. Use `tqdm-loggable` for headless logging; use `tqdm.contrib.logging` within interactive sessions to manage log output alongside progress bars.","message":"Do not confuse `tqdm-loggable` with `tqdm.contrib.logging`. They address different problems: `tqdm-loggable` converts progress bars to log messages in headless environments, while `tqdm.contrib.logging` redirects console log output to `tqdm.write()` to prevent interference with interactive bars.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If unexpected behavior occurs, check or explicitly set the `TQDM_LOGGABLE_FORCE` environment variable to control the output mode.","message":"tqdm-loggable automatically detects interactive vs. non-interactive sessions to determine whether to show an interactive bar or log messages. This auto-detection can be overridden by setting the `TQDM_LOGGABLE_FORCE` environment variable to `stdout` (force interactive), `logging` (force log output), or `auto` (restore default behavior).","severity":"gotcha","affected_versions":"All versions"},{"fix":"For feature requests or pull requests, the maintainers suggest poking them on Discord first to ensure visibility.","message":"The GitHub repository for `tqdm-loggable` indicates low activity. This means new feature requests or bug reports might experience slower response times.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of this behavioral shift. The `set_log_rate` function in `tqdm_loggable.tqdm_logging` can be used to control the frequency of log updates to suit your monitoring needs.","message":"When migrating from standard `tqdm` to `tqdm-loggable` in a headless environment, the expected output will change from no visible progress (or broken output) to periodic log messages. While this is the library's intended function, it is a significant behavioral change from `tqdm`'s default in non-interactive contexts.","severity":"breaking","affected_versions":"All versions where `tqdm` is used in headless mode"}],"env_vars":null,"search_vec":"'0.4.1':14 'activ':91 'appear':69 'applic':67 'automat':24 'backend':86 'background':46 'bar':22,29,103 'cadenc':98 'ci/cd':45,106 'configur':84 'convert':25 'current':12 'docker':44,107 'e.g':43 'ensur':48 'environ':42 'friend':19 'frozen':70 'github':93 'headless':41,104 'hidden':58 'infrequ':96 'interact':39 'lack':61 'log':18,32,54,85,100 'loggabl':3,6 'logging-friend':17 'long':73 'long-run':72 'low':90 'messag':33 'monitor':105 'non':38 'non-interact':37 'oper':76 'packag':11 'period':31 'petit':9 'prevent':66 'progress':21,28,50,80,102 'progress-bar':101 'project':88 'provid':16 'python':10 'rather':55 'regular':79 'releas':97 'report':81 'run':35,74 'send':78 'standard':26 'suggest':94 'tqdm':2,5,20,27,75,99 'tqdm-loggabl':1,4 'tti':64 'version':13 'visibl':52 'worker':47","created_at":"2026-04-12T16:53:19.089174+00:00","updated_at":"2026-04-17T14:34:51.985794+00:00","problems":[{"fix":"pip install tqdm-loggable","cause":"The 'tqdm-loggable' package has not been installed or is not accessible in the current Python environment.","error":"ModuleNotFoundError: No module named 'tqdm_loggable'"},{"fix":"from tqdm_loggable import tqdm_loggable","cause":"The user attempted to import the main class with an incorrect capitalization or name. The actual class name is 'tqdm_loggable' (lowercase).","error":"ImportError: cannot import name 'TqdmLoggable' from 'tqdm_loggable'"},{"fix":"for item in tqdm_loggable(your_iterable):","cause":"The 'tqdm_loggable' class, like 'tqdm.tqdm' which it extends, requires an iterable object as its first argument when instantiated.","error":"TypeError: __init__() missing 1 required positional argument: 'iterable'"},{"fix":"from tqdm_loggable import tqdm_loggable","cause":"The 'tqdm_loggable' class was used in the code without being imported from its module first.","error":"NameError: name 'tqdm_loggable' is not defined"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.4.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/tradingstrategy-ai/tqdm-loggable","docs":null,"changelog":"https://github.com/tradingstrategy-ai/tqdm-loggable/blob/master/CHANGELOG.md","pypi":"https://pypi.org/project/tqdm-loggable/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}