The other day I wanted to turn a python script into a website and came across streamlit - fell in love immediately. One thing leads to another and I ended up making this: Bandcamp Explorer (bc-explorer.app)
Love that streamlit gives you such a nice clean base to work with that you can customise (almost) how you like! My favourite thing here might be the use of a wrapping div around some generated markdown so that I could target it with CSS easily.
Whoa, this is super cool, @roniqueh!! I especially love that you can listen to previews within the app It’s been years since I’ve used bandcamp, and your app has nudged me to re-explore it.
Glad it’s got you going through bandcamp again! Honestly my favourite way to find music. And yes was so glad when I realised just pasting embeds with the right data works for the previews. Btw if a recommended release is an album/ep, there should be a next/back button in the embed to listen to the other tracks in there too
Wow @TomJohn, totally forgot that I had dark mode enabled on all my devices - thanks for that! Was working on 3 before, just need to think about how to implement it properly (since running with the same inputs won’t necessarily give same results between runs) - probably a UID that I can associate with the data produced from the run. Thank you for the idea with point 2, will get on that asap
Hmm @snehankekre a couple small reasons: I noticed the initial load on streamlit cloud would take a while, so I ended up wondering what it’d be like running on a cheap VPS and it seems to load initially 4-5 seconds faster for me. Since I don’t think I’ll get too many concurrent users, I figured this trade off would be worth it. Also I wanted to add my own meta tags so it’d show up on twitter/facebook etc how I’d want it to. First time making a web server too so it was nice to learn a couple of things at once.
Hmm tougher than I thought to implement your second point, since the key of that text input uses session states from the sidebar if the user selects an input from there. I’ve done it using the placeholder argument for now. Hopefully dark mode should be forced now too!
Unfortunately, dark mode is not yet available. In the streamlit community cloud, you must restart your app for changes to take effect; I’m not sure what happens when you self-host.
About default value: in one of my projects I am providing default values to the user using:
st.text_input("Base population # successes", value=a)
And a is just a variable. It seems that similar approach could be used in your app as well?
Hmm that’s strange - I’ve updated the app through Github actions which seems to work with the placeholder coming up on your screenshot. I can also see the config.toml file on my server… wonder what’s up.
And ooo yes change value argument wasn’t working before but I realised I needed to change the initial session state to the value I want to use too.
Hey, could you do me a big favour and see if dark mode forced now? I checked on edge and looks like it was… Also finally added saving results to a url
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.