streamlit / docs Goto Github PK
View Code? Open in Web Editor NEWSource code for the Streamlit Python library documentation
Home Page: https://docs.streamlit.io
License: Apache License 2.0
Source code for the Streamlit Python library documentation
Home Page: https://docs.streamlit.io
License: Apache License 2.0
Currently there is not a Knowledge Base tutorial for Azure Blob Storage.
I'm interested in contributing a new tutorial for Azure Blob Storage to the docs and creating a PR for this change.
Should be very similar to the existing S3 tutorial (creating a bucket + file, provisioning access keys, adding to secrets, etc.).
In the tutorial-based sections of our docs, we should provide a visual component showing what the code snippets they run will look like. This serves two benefits:
The simplest implementation of this would be screenshots, which would provide ~80% of the benefits for ~20% of the effort. If we wanted to get fancier, we could go on to make them live S4A apps or static embedded apps so users can directly interact with Streamlit.
Link to doc page in question (if any):
E.g.
https://docs.streamlit.io/en/stable/index.html
https://docs.streamlit.io/en/stable/getting_started.html
https://docs.streamlit.io/en/stable/tutorial/create_a_data_explorer_app.html
As part of our deprecation process, we will be adding warnings prior to deprecation when to-be deprecated functionalities are used. This can be disabled by the developer
st.set_config('deprecation.v00_051_showPyDeckWarning', False)
.streamlit/config.toml
[deprecation]
v00_051_showPyDeckWarning = False
References for more info to include:
https://www.notion.so/streamlit/Proposed-Handling-Deprecation-Breaking-Changes-927c6172822c4277a6b07b4703723204
https://www.notion.so/streamlit/Let-s-talk-about-deprecation-warnings-67885d263aa14bb1af59b497e6880a07
Likely due to the old link https://static.streamlit.io/0.25.0-2JkNY/index.html?id=Dv3M9sA7Cg8gwusgnVNTHb being pinned to a version that did not have the Range Requests fix. We should see if re-making the Static Embedded App would fix this.
See slack discussion: https://streamlit.slack.com/archives/C0132LY8TA7/p1604518452081200
(On a broader level, our testing situation on Safari leaves something to be desired)
Link to doc page in question (if any):
https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app
Name of the Streamlit feature whose docs need improvement:
In "Your app URL" section the documentation seem to be outdated
What you think the docs should say:
The name of the branch should be main
not master
. See https://github.com/github/renaming Maybe this is the reason why the link https://share.streamlit.io/streamlit/demo-self-driving is not working
It took me a little while to realize that the reason why the Network URL for my streamlit Docker container wasn't working was that it isn't actually the URL I needed to access. I needed to go to localhost:8501 instead of the URL in Network URL. I had to just guess and try things to find this out.
Since this is different than when you simply run streamlit run app.py
(this does give us the Local URL), I think it would be beneficial to either include this somewhere in the documentation (no Docker search results found in the streamlit docs) or print out localhost: in the terminal when we spin up a Docker container. From what I understand, streamlit already recognizes when it is being run in Docker (maybe not exactly) because it isn't automatically opening up a window for this exact reason (it knows Network URL is not what the user wants when running locally).
Currently our documentation has beta features mixed in with our API. It'd be great to get a separate page for these beta/experimental features as these are subject to change/removal. Also would be nice to reiterate their state
Right now, there's still a ton of manual work that goes into creating and updating a static embedded app. And the result is that we don't use them as much as we could, plus the ones we use may be many versions out of date.
(For example, I'm thinking of making a fix to st.bar_chart streamlit/streamlit#2091 , but I'm almost sure I won't update the static embedded app because it's too much of hassle.)
Some issues:
>>>
and ...
prefixes in docstrings)Ideally:
When running code demo in Step 3: Ask for username & password in your Streamlit app, got error:
streamlit.errors.DuplicateWidgetID: There are multiple identical
st.text_inputwidgets with
key='username'.
Code snippet:
See summary.
Screenshot(s):
NA
Expected behavior:
No errors in terminal
Actual behavior:
See summary.
@tvst I think this is a P0 or P1. One of the recent commits must have broken search. Clicking on the search bar brings up the search modal. However, typing into it does not cause search results to be displayed anymore. Additionally, clicking the X does not close the search modal.
You are using pip version 21.1.1; however, version 22.0.3 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
Between 1025px and 1249px screen width, the side bar overlays docs content, even if collapsed. Tested in Firefox 94.0 on my 1280x1024px screen (due to Ubuntu dash bar, actual browser window width is 1204px).
The screenshot demonstrates the behaviour. It is not possible to click links under the red area.
Fix media queries
Zoom out or make window width smaller than 1025px.
This image public/images/databases/edit-secrets.png is outdated:
Also this page has outdated screenshots
This now looks different. And might also change soon (Environment
in favor of Secrets
), so need to keep that in mind.**
Link to doc page in question (if any):
https://docs.streamlit.io/en/stable/api.html#streamlit.line_chart
Name of the Streamlit feature whose docs need improvement:
st.line_chart
What you think the docs should say:
.. warning::
Date formatted data will be adjusted for the user's timezone before being plotted on the ``st.line_chart``.
Details of issue:
The following image:
is produced by the following code:
st.write(icom_datasets)
st.line_chart(icom_datasets[["gantry", "collimator", "turn_table"]])
The plot and the dataframe print is produced by the same dataframe. The plot however silently removes (?) a presumed GMT+11 shift.
The magic docs should indicate that magic doesn't work for imported files.
Eventually, we'd like to fix the underlying bug itself.
Related to this: https://discuss.streamlit.io/t/force-redraw-of-an-earlier-element/635
Please add documentation of which types in DeltaGenerator
are redrawable.
Per one of our users on the forum "Docs seem broken just below here under ## Use Magic. I think due to a bad backtick"
Name of the Streamlit feature whose docs need improvement:
Going forward we would like to use the deprecated tag which adds a deprecated
class. I would love to have this look the same as an info block. I'm not sure if it's possible to create a component for deprecated items or if we just have control over the CSS. If we have to we can use a pure CSS and force a header with a ::before class.
Firefox has this handy option "Add a Keyword for this search":
I can add st
as a keyword, but when I type st dataframe
in Firefox's address bar, nothing really happens. I'm only dropped to the main page of the Streamlit docs. I assume this is because the search dialogue is a popup...
The URL turns to this: https://docs.streamlit.io/library/api-reference?=dataframe
An example, where searching via address bar keyword works, is https://devdocs.io/. I have the keyword dd
for that and I can directly search in the search box of their web app.
Link to doc page in question (if any): https://docs.streamlit.io/en/stable/api.html#streamlit.cache
Name of the Streamlit feature whose docs need improvement: cache
The docs for allow_output_mutation
say:
Streamlit normally shows a warning when return values are not mutated, as that can have unintended consequences. This is done by hashing the return value internally.
If you know what you’re doing and would like to override this warning, set this to True.
However, based on the name, and behavior with the default value of False, it should say Streamlit normally shows a warning when return values are mutated
, without the "not".
Link to doc page in question (if any):
https://docs.streamlit.io/en/stable/streamlit_configuration.html
Name of the Streamlit feature whose docs need improvement:
Need to add a new line
What you think the docs should say:
Reserve port 3000 port in streamlit or reverse proxy. If you use it, it can do weird behavior
Reserve port 3000 because it is used for the development
Mixing and mentioning different python packet managers is maybe confusing for beginners, especially if they move on from local development to streamlit cloud.
This is related to this forum thread:
https://discuss.streamlit.io/t/modulenotfounderror-despite-simple-requirements-txt-present/23795/10
The documentation first recommends to use pipenv and Pipfile for dependencies
But the next page says: “1. Put your app in a public GitHub repo (and make sure it has a requirements.txt!)”
Thanks but for a normal user who reads the documentation in order the first page is “Installation” where you’re told to use Pipfile and the next page is “Create an app” where you’re told to “make sure it has a requirements.txt!”.
It would be great to add a link to that page (“App dependencies”) in the “Installation” page of the documentation. And to mention clearly there that “You should only use one requirements file for your app. If you include more than one (e.g. requirements.txt and Pipfile). Streamlit will first look in the directory of your Streamlit app; however, if no requirements file is found, Streamlit will then look at the root of the repo.”
Hi, there! 🌞
I have been noticed this project since last October (the Version 0.47.0), after that I wrote several articles to introduce it on my wechat blog in Chinse. Some of my collegues shared their interest about it, so I also translated the API reference for them.
Nowadays, I wonder if I can contribute those Chinese documents back to this project. The latest Chinese version I have correspond to the Version 0.49.0.
With no doubt, I am happy to update those to the lateset Version, too.
Please let me know if you guys think it is useful and have willingness to attach it to the official documentation.
Best Regards
🎈🎈🎈
Hiii Streamlit Team,
As per the documentation given here , currently Streamlit supports connection to Big Query , My Sql and various other databases . But I noticed that there is no functionality and module available to connect to Oracle Database .
Oracle Databases are used by lot of companies and adding module to connect to Oracle Database will make streamlit more complete and diverse library !
So can you please look into it and make the latest version available.
Thanks and Regards
Athar
Link to doc page in question (if any):
https://docs.streamlit.io/library/api-reference/data/st.dataframe#stdataframe
Name of the Streamlit feature whose docs need improvement:
Code output/result
What you think the docs should say:
There are 3 code cells but only 2 outputs. The middle one, st.dataframe(df, 200, 100)
has no output for example of streamlit dataframe component resized.
Name of the Streamlit feature whose docs need improvement:
I think it's nice to have a Streamlit documentation in Japanese. There are so many Japanese articles about Streamlit, and I also did write a blog before.
If you want a Japanese translation and its maintenance, I would love to help it out!
Last year there was an issue about making a Chinese version of it ( #99 )
@tvst I assume we'd use Apache 2.0 here as well?
After the search bar is clicked, it cannot be closed by clicking on the X icon. Only pressing the ESC
key closes the search modal.
Navigating to https://docs.streamlit.io/library/get-started/main-concepts#app-model does not scroll the page down to the corresponding section. I tried navigating to a few other parts of the page via fragment, and they don't seem to be running into the same issue.
What seems to be a related bug is present when clicking on the page navigation links on the right hand side of the page -- clicking on the "App model" link brings you to the caching header.
TLDR: you either need to use the ReportThread class for your thread, or call add_report_ctx on your thread after creation
I recently came across this issue and couldn't find anything in the documentation that called it out. I figured that either this is truly a bug, or the documentation should be updated to include a comment on this so that other users aren't caught off guard like I was.
app/
├── pages/
│ ├──page1.py
└── main.py
main.py:
import streamlit as st
from pages import page1
st.write('Main')
page1.display()
page1.py:
import streamlit as st
def display():
st.write('Page 1')
streamlit run main.py
Changing code in any files in subfolders would also be detected by Streamlit.
The changes in the subfolder files aren't detected by Streamlit.
Simply adding an empty __init__.py
to pages/
, killing the app, then restarting it will fix the issue. The working folder structure then looks like this:
app/
├── pages/
│ ├── __init__.py
│ └── page1.py
└── main.py
No idea, but probably not.
Link to doc page in question (if any):
https://docs.streamlit.io/en/stable/api.html#streamlit.radio
Name of the Streamlit feature whose docs need improvement:
Any interactive widget that receives an OptionSequence
What you think the docs should say:
All such widgets are typed so that they return a string. This is however not true since the type of the return value is dependent on the type of the options
sequence. A generic approach is neeed here.
OptionSequence should be converted to
OptionGenericType = TypeVar('OptionGenericType')
OptionSequence = Sequence[OptionGenericType]
IMO the union is not needed since np.ndarray, pd.DataFrame and so on fullfill the sequence protocol
and the signature of e.g. selectbox will be:
def selectbox(
self,
label: str,
options: OptionSequence,
index: int = 0,
format_func=Callable[[OptionGenericType], str],
key: Optional[Key] = None,
help: Optional[str] = None,
on_change: Optional[WidgetCallback] = None,
args: Optional[WidgetArgs] = None,
kwargs: Optional[WidgetKwargs] = None,
) -> OptionGenericType
I write this as my most common use case is to provide a list of TypedDict
s to selectbox and then use format_func for formatting.
Link to doc page in question (if any):
https://docs.streamlit.io/library/api-reference/control-flow/st.experimental_rerun
Name of the Streamlit feature whose docs need improvement:
st.experimental_rerun
What you think the docs should say:
I have encountered a puzzling warning using st.button
callback functions. The warning states:
Calling st.experimental_rerun() within a callback is a no-op.
I can't find any information about this warning except this pull request which appears to implement the warning Make calling st.experimental_rerun() within a callback a no-op which closes this issue: Rerunning the session does not work inside callbacks.
The simple test app I made using the following code triggers this warning (when buttons are pressed in succession) even though st.experimental_rerun
is not explicitly run anywhere:
import streamlit as st
def left_callback():
st.write('Left button was clicked')
def right_callback():
st.write('Right button was clicked')
left_col, right_col, _ = st.columns([1, 1, 3])
with left_col:
st.button('LEFT', on_click=left_callback)
with right_col:
st.button('RIGHT', on_click=right_callback)
It appears that it is an issue with session state and callbacks not properly working together or the app being re-run inside one of the callbacks under the hood.
My suggestion is to add information about possible warnings that st.experimental_rerun()
may trigger, including this one I have mentioned. Or add a functionality to suppress the warning. I don't think this is a bug, so I submit this as a documentation improvement in the hopes of getting some answers about why this warning is triggered.
All Streamlit widgets have a key
internally (and we actually call it id
in the code). These keys are important since widget state is tracked as a key→value map. So when two widgets have the same key, things go crazy. (That's why we recently started showing a warning when that happens.)
The key is computed from a hash of the widget type and all the widget arguments. And we provide an extra kwarg called key
that can be used to disambiguate. For example:
box1 = st.selectbox("", [1, 2, 3], key="box1")
box2 = st.selectbox("", [4,5,6], key="box2")
But none of this is in the docs! We should explain this somewhere.
Maybe we could use a higher resolution for that join.png
image?
Link to doc page in question (if any): https://docs.streamlit.io/en/stable/api.html#streamlit.number_input
Name of the Streamlit feature whose docs need improvement: st.number_input
What you think the docs should say:
Hi folks! Found out when I was copy-pasting the integers generated by torch.seed()
into st.number_input
, that the last few digits went to zero after enter is pressed. There appears to be a limit for how long an integer input can be, which is something we don't deal with in Python, given its capability to natively handle big integers.
This appears to be floating point behaviour where the number ran out of significands. Digging around in the code base, seems that the Python side of the widget source code uses integers natively. Thus, I'm guessing that the limit to integer length is inherent to how Javascript stores the number internally before passing it to the Streamlit application. But I digress.
Anyway, I thought it would be worth mentioning number_input
's limitation in handling big integers. As a workaround, users can use st.text_input
and post-process the input values instead. This docs improvement should be relevant to folks building machine learning apps, where large ints can be involved in setting RNG seeds.
I'll put in a PR if the maintainers are OK w/ the proposed improvement.
Check if large dataset is supported in streamlit (how big it can go).
Its kind of useful if we try to put in production setup
and prevent crash if users use with bigger dataset.
Take some dataset like the taxi NYC and run it as Regression Tests or Unit Tests.
in the tutorial step "animate elements" the import statements are missing. using the statements from the previous examples does not work as import time is missing. It is added though in the next example: Return the value of a Streamlit call. I suggest you add the required import statements to all examples that should run on its own. I agree this might seem picky as the error is found quickly but the tutorial is just so much more impressive if everything just runs immediately.
See video:
When Streamlit
is clicked nothing happens, I checked index.md
in /content
folder, there's a link associated with Streamlit
which should redirect to Streamlit homepage, but it isn't the case on the new documentation index page.
Hey Streamlit,
I am one of the maintainers of the python client libraries for Supabase . Supabase is, loosely speaking, an open source firebase. Streamlit is a great product and I was hoping that we could file a PR with a guide on how to use Supabase as a data source for Streamlit.
Wanted to seek your approval before doing this though.
Let us know!
Joel
Link to doc page in question (if any):
https://streamlit.io/docs/api.html#streamlit.slider
Name of the Streamlit feature whose docs need improvement:
st.slider
What you think the docs should say:
It's not super clear that you can pass a tuple to create a range slider.
And perhaps we should also mention it in get started
I've started developing some apps with Streamlit and noticed there is no Knowledge Base tutorial for Google Cloud Storage (however there is one for Amazon S3).
I'm interested in contributing a new GCS tutorial to the docs and creating a PR for this change.
Should be very similar to the Streamlit tutorials for other Google data sources (BigQuery and Google Sheets) where we enable the API, create service account + key, add the secrets to the cloud, etc.
Was working on providing a small example of using graphviz to render Decision Tree in streamlit/streamlit#1330 but code did not work. Then tried the 2 examples from API reference and none worked on my machine. Then tried this one. All got the same errors about viz not being defined 🤔 is it only me ?
graph = graphviz.Digraph()
graph.edge('run', 'intr')
graph.edge('intr', 'runbl')
graph.edge('runbl', 'run')
graph.edge('run', 'kernel')
graph.edge('kernel', 'zombie')
graph.edge('kernel', 'sleep')
graph.edge('kernel', 'runmem')
graph.edge('sleep', 'swap')
graph.edge('swap', 'runswap')
graph.edge('runswap', 'new')
graph.edge('runswap', 'runmem')
graph.edge('new', 'runmem')
graph.edge('sleep', 'runmem')
st.graphviz_chart(graph)
st.graphviz_chart('''
digraph {
run -> intr
intr -> runbl
runbl -> run
run -> kernel
kernel -> zombie
kernel -> sleep
kernel -> runmem
sleep -> swap
swap -> runswap
runswap -> new
runswap -> runmem
new -> runmem
sleep -> runmem
}
''')
Displays graph
Frontend logs for me
Loading script from “http://localhost:8501/vendor/viz/viz-1.8.0.min.js” with importScripts() was blocked because of a disallowed MIME type (“text/plain”).
NetworkError: WorkerGlobalScope.importScripts: Failed to load worker script at http://localhost:8501/vendor/viz/viz-1.8.0.min.js
uncaught exception: Viz is not defined
Probably
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.