You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This ticket is spawned by a recent Stack Overflow question, grep a live progress bar from a running program. The party asking this question was looking for a way to run a piece of software -- which, as it turns out, uses tqdm for its progress bar -- and monitor its progress programmatically, triggering an event when that progress exceeded a given threshold.
This is not an unreasonable request, and I've occasionally had the need for similar things in my career. Generally, solving such problems ends up going one of a few routes:
Patching the software being run to add hooks that trigger when progress meets desired milestones (unfortunate because invasive).
Parsing the output stream being generated (unfortunate because fragile -- prone to break when the progress bar format is updated, the curses or similar library being used to generate events changes, the terminal type or character set in use differs from that which the folks building the parser anticipated, etc).
Leveraging support for writing progress information in a well-defined format to a well-defined destination.
This is a feature request to make the 3rd of those available by default across all applications using TQDM.
One reasonable interface accessible to non-Python consumers would be environment variables, such as:
TQDM_FD=3 TQDM_FORMAT=json appname...
...to instruct progress data to be written to file descriptor 3 (aka the file-like object returned by os.fdopen(3, 'a')) in JSONL form, such that whatever software is spawning appname can feed contents through a JSON parser. Some examples from the README might in this form look like:
...allowing out-of-process tools written in non-Python languages to perform arbitrary operations based on that status.
I have marked all applicable categories:
documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
This ticket is spawned by a recent Stack Overflow question, grep a live progress bar from a running program. The party asking this question was looking for a way to run a piece of software -- which, as it turns out, uses tqdm for its progress bar -- and monitor its progress programmatically, triggering an event when that progress exceeded a given threshold.
This is not an unreasonable request, and I've occasionally had the need for similar things in my career. Generally, solving such problems ends up going one of a few routes:
This is a feature request to make the 3rd of those available by default across all applications using TQDM.
One reasonable interface accessible to non-Python consumers would be environment variables, such as:
...to instruct progress data to be written to file descriptor 3 (aka the file-like object returned by
os.fdopen(3, 'a')
) in JSONL form, such that whatever software is spawningappname
can feed contents through a JSON parser. Some examples from the README might in this form look like:...allowing out-of-process tools written in non-Python languages to perform arbitrary operations based on that status.
read the known issues
environment, where applicable:
The text was updated successfully, but these errors were encountered: