-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. **26ba552** List of tags updated with inclusion of tag `First-10-days` 1. **3b7b26b** Tasks from day 11 - Multi selector 1. **4340201** Tasks from day 12 - Check box 1. **0a690d5** Task from day 14: embed pandas profiling into streamlit using components - Some changes were required to make this code to work: - Downgrade to Python 3.9.3 due to several conflicts of streamlit-pandas-profiling with pydantic and pandas-profiling / ydata-profiling - Conflict with Pydantic version 2: had to fix version in version 1 via pydantic = "==1.*" 1. **b48fc18** Task from day 15: Latex equation 1. **e94741f** Added a .gitattributes file to normalize line endings - https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ 1. **2f05014** Task of day 16 - Theming - It didn't work as easy as expected since theme conflicts with user selection in streamlit widgets in browser's page - Initially config.toml was not being recognized or parsed properly - Extra can be done via CSS hacks as next commit will show (https://discuss.streamlit.io/t/font-size-of-slider-caption/36073/3) 1. **524d74e** CSS Hack to increase font size of slider caption - https://discuss.streamlit.io/t/font-size-of-slider-caption/36073/3 2. **1737c8c** Code for day 17 - Secret manipulation 1. **5bd645c** Configuration to debug streamlit applications, interactively, in VS Code 1. **ccbe923** Conditional manipulation of secrets by streamlit. File saved here doesn't contain any real secret. Just for learning purposes 1. **a8fe324** Example of acessing secrets in \`secrets.toml\` files 1. **ae4bf8d** Tasks from day 18: manipulating and displaying CSVs 1. **7a7450e** Task from day 19 - Layout
- Loading branch information
Showing
31 changed files
with
10,848 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.gitattributes eol=lf | ||
* text=lf | ||
*.json eol=lf | ||
*.py eol=lf | ||
*.toml eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: Current File with Arguments", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"args": [ | ||
"${command:pickArgs}" | ||
] | ||
}, | ||
{ | ||
"name": "Streamlit - Day17", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "streamlit", | ||
"args": [ | ||
"run", | ||
"${workspaceFolder}/day17/day17.py", | ||
"--server.port", | ||
"8501" | ||
], | ||
"cwd": "${workspaceFolder}/day17" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import streamlit as st | ||
|
||
st.header('st.multiselect') | ||
|
||
options = st.multiselect( | ||
'What are your favorite colors', | ||
['Green', 'Yellow', 'Red', 'Blue'], | ||
['Yellow', 'Red']) | ||
|
||
st.write('You selected:', options) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[tool.poetry] | ||
name = "day11" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Dickson Souza <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
streamlit = "^1.39.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import streamlit as st | ||
|
||
st.header('st.checkbox') | ||
|
||
st.write ('What would you like to order?') | ||
|
||
icecream = st.checkbox('Ice cream') | ||
coffee = st.checkbox('Coffee') | ||
cola = st.checkbox('Cola') | ||
|
||
if icecream: | ||
st.write("Great! Here's some more 🍦") | ||
|
||
if coffee: | ||
st.write("Okay, here's some coffee ☕") | ||
|
||
if cola: | ||
st.write("Here you go 🥤") |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[tool.poetry] | ||
name = "day12" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Dickson Souza <[email protected]>"] | ||
readme = "README.md" | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
streamlit = "^1.39.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import streamlit as st | ||
import pandas as pd | ||
from streamlit_pandas_profiling import st_profile_report | ||
|
||
st.header('`streamlit_pandas_profiling`') | ||
|
||
df = pd.read_csv('https://raw.githubusercontent.com/dataprofessor/data/master/penguins_cleaned.csv') | ||
|
||
pr = df.profile_report() | ||
st_profile_report(pr) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[tool.poetry] | ||
name = "day14" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Dickson Souza <[email protected]>"] | ||
readme = "README.md" | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python=">=3.9,<3.9.7 || >3.9.7,<3.11" | ||
streamlit = "^1.39.0" | ||
streamlit-pandas-profiling = "^0.1.3" | ||
pydantic = "==1.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import streamlit as st | ||
|
||
st.header('st.latex') | ||
|
||
st.latex(r''' | ||
a + ar + a r^2 + a r^3 + \cdots + a r^{n-1} = | ||
\sum_{k=0}^{n-1} ar^k = | ||
a \left(\frac{1-r^{n}}{1-r}\right) | ||
''') |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[tool.poetry] | ||
name = "day15" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Dickson Souza <[email protected]>"] | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
streamlit = "^1.39.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[theme] | ||
primaryColor="#F39C12" | ||
backgroundColor="#85c8f5" | ||
secondaryBackgroundColor="#ffffff" | ||
textColor="#221d1d" | ||
font="sans serif" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import streamlit as st | ||
|
||
st.markdown( | ||
""" | ||
<style> | ||
div[class*="stSlider"] > label > div[data-testid="stMarkdownContainer"] > p { | ||
font-size: 30px; | ||
} | ||
</style> | ||
""", | ||
unsafe_allow_html=True | ||
) | ||
|
||
st.title('Customizing the theme of Streamlit apps') | ||
|
||
st.write('Contents of the `.streamlit/config.toml` file of this app') | ||
|
||
st.code(""" | ||
[theme] | ||
primaryColor="#F39C12" | ||
backgroundColor="#2E86C1" | ||
secondaryBackgroundColor="#AED6F1" | ||
textColor="#FFFFFF" | ||
font="monospace" | ||
""") | ||
|
||
number = st.sidebar.slider('Select a number:', 0, 10, 5) | ||
st.write('Selected number from slider widget is:', number) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[tool.poetry] | ||
name = "day16" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Dickson Souza <[email protected]>"] | ||
package-mode = false | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
streamlit = "^1.39.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Everything in this section will be available as an environment variable | ||
db_username = "Jane" | ||
db_password = "mypassword" | ||
|
||
# You can also add other sections if you like. | ||
# The contents of sections as shown below will not become environment variables, | ||
# but they'll be easily accessible from within Streamlit anyway as we show | ||
# later in this doc. | ||
[my_other_secrets] | ||
things_i_like = ["Streamlit", "Python"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import streamlit as st | ||
|
||
st.title('st.secrets') | ||
|
||
try: | ||
if 'db_username' in st.secrets: | ||
st.write(f"db_username: {st.secrets['db_username']}") | ||
|
||
if 'db_password' in st.secrets: | ||
st.write(f"db_password: {st.secrets['db_password']}") | ||
|
||
if 'my_other_secrets' in st.secrets: | ||
st.write(f"All other secrets: {st.secrets['my_other_secrets']}") | ||
|
||
for item in st.secrets['my_other_secrets'].items(): | ||
st.write(item) | ||
|
||
except: | ||
st.write("There is no secret saved.") |
Oops, something went wrong.