wirg / stqdm Goto Github PK
View Code? Open in Web Editor NEWstqdm is the simplest way to handle a progress bar in streamlit app.
Home Page: https://github.com/Wirg/stqdm
License: Apache License 2.0
stqdm is the simplest way to handle a progress bar in streamlit app.
Home Page: https://github.com/Wirg/stqdm
License: Apache License 2.0
Love this project and have been using it all the time with any ST apps I build.
just wondering if there's any plan to wrap stqdm on top of the equally amazing p_tqdm
Describe the bug
I'm using the progress bar to track a process in my script.
I can't set the bar like "for _ in stqdm(range(x)):" because I have several loops to control process and I only want one bar.
after several uses or when I do large calculations, the bar is no longer usable and the script no longer works. There is no error displayed and the bar is no longer displayed. However the st.spinner launches well before.
To Reproduce
import streamlit as st
from stqdm import stqdm
def exemple_run(test1, test2):
total_iterations = len(test1) + len(test2)
with stqdm(total=total_iterations, desc='Calculating...', mininterval=0.1) as pbar:
for _ in test1:
pbar.update(1)
for _ in test2:
pbar.update(1)
if st.button("Exemple"):
with st.spinner("Processing..."):
exemple_run(test1, test2)
Desktop (please complete the following information):
While a for loop enclosed in stqdm is running, if you press the "Stop" button, in the top right corner of any Streamlit app, the code stops running (as expected) but then becomes non-functional. That is, if you try to again interact with the code, it misbehaves and doesn't do what is otherwise expected or .
To Reproduce
Example :
from time import sleep
from stqdm import stqdm
import streamlit as st
submit = st.button('Click me')
if submit:
for _ in stqdm(range(50)):
sleep(0.5)
Expected behavior
The code should function exactly as it was functioning before pressing the "Stop" button.
The code doesn't behave as expected as shown in the below.
Desktop (please complete the following information):
Describe the bug
Traceback (most recent call last):
File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\tqdm\std.py", line 1149, in __del__
self.close()
File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\stqdm\stqdm.py", line 109, in close
super().close()
File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\tqdm\std.py", line 1278, in close
if self.last_print_t < self.start_t + self.delay:
AttributeError: 'stqdm' object has no attribute 'last_print_t'
To Reproduce
A simple app with two stqdm instances will produce the error upon a few reruns.
Desktop (please complete the following information):
Hi, with the new layout options for Streamlit (https://blog.streamlit.io/introducing-new-layout-options-for-streamlit/) it would be really great if I could use stqdm inside of a column or a container
Hello, @Wirg
First of all, thanks for implementing this wonderful idea.
I tried to disable backend progressbar and only allow progressbar in streamlit application.
so I passed the parameter like this
for idx in stqdm(range(len(data)), backend=False, frontend=True):
However, it showed error.
TqdmKeyError: "Unknown argument(s): {'backend': False, 'frontend': True}"
My current library versions are as followed.
I installed stqdm via pip
tqdm == 4.61.1
stqdm == 0.0.3
streamlit == 0.83.0
I would like to have "backend" and "frontend" set for all widgets. Would be nice to set it up once for as default for all.
Currently I think it is only possible to change each widget/instance separately.
In my streamlit app I have multiple async tasks for which I want to track progress. This is possible with tqdm.asyncio but it's not supported in stqdm. I think it would be a great feature.
Describe the bug
stqdm doesn't work on a python loop that uses the enumerate function
To Reproduce
values = ["a", "b", "c"]
for count, value in stqdm(enumerate(values)):
sleep(1)
doesn't work.
However
values = ["a", "b", "c"]
for value in stqdm(values)):
sleep(1)
works normally
Describe the bug
The leave option of the stqdm
progress bar should have an effect not only for the inherited tqdm
. The change below should fix this.
Current:
def close(self):
super().close()
self.st_clear()
Proposed change:
def close(self):
super().close()
if self.leave is False: # <-- Check if leave is desired
self.st_clear()
I use a library foo
which use tqdm in it:
from tqdm.auto import tqdm
And in my own code:
import streamlit as st
from foo import bar
bar()
How can I replace it with stqdm
while I can not modify foo
library?
Describe the bug
Hi, first of all, thanks for this, it's great ! I'd like to report what I think is a bug. I'm trying to get to display only the progress bar and no additional info. Like this :
Unfortunately, with stqdm, even when setting the bar_format parameter, additional info still shows.
To Reproduce
Steps to reproduce the behavior :
from stqdm import stqdm
from time import sleep
for item in stqdm(range(10), bar_format="{bar}"):
sleep(0.5)
I might be missing something, but since stqdm inherits from tdqm, I think this should be working ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.