Skip to content

Commit 467389d

Browse files
Release 1.44.0 (#1266)
* Update streamlit.json * Add locale * st.badge * st.exception (thumbnail) * Update config options * Update CLI reference * Release notes * What's new & Cheat sheet * Update content/develop/api-reference/command-line/init.md Co-authored-by: Copilot <[email protected]> * Update content/develop/api-reference/command-line/init.md Co-authored-by: Copilot <[email protected]> * Typo --------- Co-authored-by: Copilot <[email protected]>
1 parent a2d19fa commit 467389d

File tree

22 files changed

+11436
-137
lines changed

22 files changed

+11436
-137
lines changed

content/develop/api-reference/_index.md

+13
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ Display text in subheader formatting.
116116
st.subheader("This is a subheader")
117117
```
118118

119+
</RefCard>
120+
<RefCard href="/develop/api-reference/text/st.badge">
121+
122+
<Image pure alt="screenshot" src="/images/api/badge.jpg" />
123+
124+
<h4>Badge</h4>
125+
126+
Display a small, colored badge.
127+
128+
```python
129+
st.badge("New")
130+
```
131+
119132
</RefCard>
120133
<RefCard href="/develop/api-reference/text/st.caption">
121134

content/develop/api-reference/caching-and-state/context.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ description: st.context displays a read-only dict of cookies and headers
1010

1111
<Autofunction function="context.headers" />
1212

13+
<Autofunction function="context.locale" />
14+
1315
<Autofunction function="context.timezone" />
1416

1517
<Autofunction function="context.timezone_offset" />

content/develop/api-reference/command-line/_index.md

+13-50
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,23 @@ When you install Streamlit, a command-line (CLI) tool gets installed
99
as well. The purpose of this tool is to run Streamlit apps, change Streamlit configuration options,
1010
and help you diagnose and fix issues.
1111

12-
To see all of the supported commands:
12+
## Available commands
1313

14-
```bash
15-
streamlit --help
16-
```
17-
18-
### Run Streamlit apps
19-
20-
```bash
21-
streamlit run your_script.py [-- script args]
22-
```
23-
24-
Runs your app. At any time you can stop the server with **Ctrl+c**.
14+
- [`streamlit cache clear`](/develop/api-reference/cli/cache): Clear the on-disk cache.
15+
- [`streamlit config show`](/develop/api-reference/cli/config): Show all configuration options.
16+
- [`streamlit docs`](/develop/api-reference/cli/docs): Open the Streamlit docs.
17+
- [`streamlit hello`](/develop/api-reference/cli/hello): Run an example Streamlit app.
18+
- [`streamlit help`](/develop/api-reference/cli/help): Show the available CLI commands.
19+
- [`streamlit init`](/develop/api-reference/cli/init): Create the files for a new Streamlit app.
20+
- [`streamlit run`](/develop/api-reference/cli/run): Run your Streamlit app.
21+
- [`streamlit version`](/develop/api-reference/cli/version): Show the version of Streamlit.
2522

26-
<Note>
23+
### Run your app
2724

28-
When passing your script some custom arguments, **they must be passed after
29-
two dashes**. Otherwise the arguments get interpreted as arguments to Streamlit
30-
itself.
31-
32-
</Note>
33-
34-
To see the Streamlit 'Hello, World!' example app, run `streamlit hello`.
35-
36-
### View Streamlit version
37-
38-
To see what version of Streamlit is installed, just type:
25+
The most important command is `streamlit run`, which is summarized for convenience here:
3926

4027
```bash
41-
streamlit version
28+
streamlit run your_script.py
4229
```
4330

44-
### View documentation
45-
46-
```bash
47-
streamlit docs
48-
```
49-
50-
Opens the Streamlit documentation (i.e. this website) in a web browser.
51-
52-
### Clear cache
53-
54-
```bash
55-
streamlit cache clear
56-
```
57-
58-
Clears persisted files from the on-disk [Streamlit cache](/develop/api-reference/caching-and-state), if
59-
present.
60-
61-
### View all configuration options
62-
63-
As described in [Configuration](/develop/concepts/configuration), Streamlit has several
64-
configuration options. To view them all, including their current values, just type:
65-
66-
```bash
67-
streamlit config show
68-
```
31+
At any time, in your terminal, you can stop the server with **Ctrl+C**.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: streamlit cache
3+
slug: /develop/api-reference/cli/cache
4+
---
5+
6+
## `$ streamlit cache clear`
7+
8+
Clear persisted files from the on-disk [Streamlit cache](/develop/api-reference/caching-and-state), if present.
9+
10+
### Syntax
11+
12+
```
13+
streamlit cache clear
14+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: streamlit config show
3+
slug: /develop/api-reference/cli/config
4+
---
5+
6+
## `$ streamlit config show`
7+
8+
Print all the available configuration options, including their descriptions, default values, and current values. For more information about configuration options, see [`config.toml`](/develop/api-reference/configuration/config.toml).
9+
10+
### Syntax
11+
12+
```
13+
streamlit config show
14+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: streamlit docs
3+
slug: /develop/api-reference/cli/docs
4+
---
5+
6+
## `$ streamlit docs`
7+
8+
Open the Streamlit docs in your default browser.
9+
10+
### Syntax
11+
12+
```
13+
streamlit docs
14+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: streamlit hello
3+
slug: /develop/api-reference/cli/hello
4+
---
5+
6+
## `$ streamlit hello`
7+
8+
Run the Hello app, an example Streamlit app included with the Streamlit library.
9+
10+
### Syntax
11+
12+
```
13+
streamlit hello
14+
```
15+
16+
### Options
17+
18+
The `hello` command accepts configuration options (just like the `run` command does). Configuration options are passed in the form of `--<section>.<option>=<value>`. For example, if you want to set the primary color of your app to blue, you could use one of the three equivalent options:
19+
20+
- `--theme.primaryColor=blue`
21+
- `--theme.primaryColor="blue"`
22+
- `--theme.primaryColor=#0000FF`
23+
24+
For a complete list of configuration options, see [`config.toml`](/develop/api-reference/configuration/config.toml) in the API reference. For examples, see below.
25+
26+
### Example
27+
28+
#### Example 1: Run the Hello app with default settings
29+
30+
To verify that Streamlit is installed correctly, this command runs an example app included in the Streamlit library. From any directory, execute the following:
31+
32+
```
33+
streamlit hello
34+
```
35+
36+
Streamlit will start the Hello app and open it in your default browser. The source for the Hello app can be [viewed in GitHub](https://github.com/streamlit/streamlit/tree/develop/lib/streamlit/hello).
37+
38+
#### Example 2: Run the Hello app with a custom config option value
39+
40+
To run the Hello app with a blue accent color, from any directory, execute the following:
41+
42+
```
43+
streamlit hello --theme.primaryColor=blue
44+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: streamlit help
3+
slug: /develop/api-reference/cli/help
4+
---
5+
6+
## `$ streamlit help`
7+
8+
Print the available commands for the Streamlit CLI tool. This command is equivalent to executing `streamlit --help`.
9+
10+
### Syntax
11+
12+
```
13+
streamlit help
14+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: streamlit init
3+
slug: /develop/api-reference/cli/init
4+
---
5+
6+
## `$ streamlit init`
7+
8+
This command creates the files for a new Streamlit app.
9+
10+
### Syntax
11+
12+
```
13+
streamlit init <directory>
14+
```
15+
16+
### Arguments
17+
18+
`<directory>` (Optional): The directory location of the new project. If no directory is provided, the current working directory will be used.
19+
20+
### Examples
21+
22+
#### Example 1: Create project files the current working directory
23+
24+
1. In your current working directory (CWD), execute the following:
25+
26+
```bash
27+
streamlit init
28+
```
29+
30+
Streamlit creates the following files:
31+
```
32+
CWD/
33+
├── requirements.txt
34+
└── streamlit_app.py
35+
```
36+
37+
2. In your terminal, Streamlit prompts, `❓ Run the app now? [Y/n]`. Enter `Y` for yes.
38+
39+
This is equivalent to executing `streamlit run streamlit_app.py` from your current working directory.
40+
41+
3. Begin editing your `streamlit_app.py` file and save your changes.
42+
43+
#### Example 2: Create project files in another directory
44+
45+
1. In your current working directory (CWD), execute the following:
46+
47+
```bash
48+
streamlit init project
49+
```
50+
51+
Streamlit creates the following files:
52+
```
53+
CWD/
54+
└── project/
55+
├── requirements.txt
56+
└── streamlit_app.py
57+
```
58+
59+
2. In your terminal, Streamlit prompts, `❓ Run the app now? [Y/n]`. Enter `Y` for yes.
60+
61+
This is equivalent to executing `streamlit run project/streamlit_app.py` from your current working directory.
62+
63+
3. Begin editing your `streamlit_app.py` file and save your changes.

content/develop/api-reference/command-line/run.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ slug: /develop/api-reference/cli/run
55

66
## `$ streamlit run`
77

8+
This command starts your Streamlit app.
9+
810
### Syntax
911

1012
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: streamlit version
3+
slug: /develop/api-reference/cli/version
4+
---
5+
6+
## `$ streamlit version`
7+
8+
Print Streamlit's version number. This command is equivalent to executing `streamlit --version`.
9+
10+
### Syntax
11+
12+
```
13+
streamlit version
14+
```

0 commit comments

Comments
 (0)