From ffd06d30452b6d2011646dc14f5971dcf3e05d03 Mon Sep 17 00:00:00 2001 From: Garrett Grolemund Date: Wed, 2 Oct 2024 16:24:20 -0500 Subject: [PATCH] Adds Deploy to Connect Cloud buttons to app READMEs (#1709) Co-authored-by: Barret Schloerke --- examples/airmass/README.md | 3 ++ examples/annotation-export/README.md | 3 ++ examples/annotation-export/requirements.txt | 2 ++ examples/brownian/README.md | 1 + examples/busy_indicators/README.md | 3 ++ examples/busy_indicators/requirements.txt | 3 ++ examples/chat/RAG/recipes/requirements.txt | 4 +++ examples/chat/README.md | 16 ++++++++++ examples/chat/hello-world/requirements.txt | 1 + examples/chat/playground/requirements.txt | 4 +++ examples/chat/ui/clear/requirements.txt | 2 ++ examples/chat/ui/dark/requirements.txt | 2 ++ examples/chat/ui/dynamic/requirements.txt | 2 ++ examples/chat/ui/sidebar/requirements.txt | 2 ++ examples/cpuinfo/README.md | 3 ++ examples/cpuinfo/requirements.txt | 5 ++++ examples/dataframe/README.md | 3 ++ examples/dataframe/requirements.txt | 4 +++ examples/duckdb/README.md | 3 ++ examples/duckdb/requirements.txt | 2 +- examples/event/README.md | 3 ++ examples/event/requirements.txt | 1 + examples/express/README.md | 33 +++++++++++++++++++++ examples/express/hold_app.py | 2 +- examples/express/requirements.txt | 3 ++ examples/global_pyplot/README.md | 3 ++ examples/global_pyplot/requirements.txt | 2 ++ examples/headers/README.md | 3 ++ examples/headers/requirements.txt | 1 + examples/inputs-update/README.md | 3 ++ examples/inputs-update/requirements.txt | 1 + examples/load_balance/README.md | 3 ++ examples/load_balance/requirements.txt | 2 ++ examples/model-score/README.md | 3 ++ examples/model-score/requirements.txt | 1 + examples/moduleapp/README.md | 3 ++ examples/moduleapp/requirements.txt | 1 + examples/penguins/README.md | 3 ++ examples/penguins/requirements.txt | 4 +-- examples/req/README.md | 3 ++ examples/req/requirements.txt | 1 + examples/static_plots/README.md | 3 ++ examples/static_plots/requirements.txt | 6 ++++ examples/typed_inputs/README.md | 3 ++ examples/typed_inputs/requirements.txt | 1 + examples/ui-func/README.md | 3 ++ examples/ui-func/requirements.txt | 2 ++ 47 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 examples/airmass/README.md create mode 100644 examples/annotation-export/README.md create mode 100644 examples/brownian/README.md create mode 100644 examples/busy_indicators/README.md create mode 100644 examples/busy_indicators/requirements.txt create mode 100644 examples/chat/RAG/recipes/requirements.txt create mode 100644 examples/chat/hello-world/requirements.txt create mode 100644 examples/chat/playground/requirements.txt create mode 100644 examples/chat/ui/clear/requirements.txt create mode 100644 examples/chat/ui/dark/requirements.txt create mode 100644 examples/chat/ui/dynamic/requirements.txt create mode 100644 examples/chat/ui/sidebar/requirements.txt create mode 100644 examples/cpuinfo/README.md create mode 100644 examples/cpuinfo/requirements.txt create mode 100644 examples/dataframe/README.md create mode 100644 examples/dataframe/requirements.txt create mode 100644 examples/duckdb/README.md create mode 100644 examples/event/README.md create mode 100644 examples/event/requirements.txt create mode 100644 examples/express/README.md create mode 100644 examples/express/requirements.txt create mode 100644 examples/global_pyplot/README.md create mode 100644 examples/global_pyplot/requirements.txt create mode 100644 examples/headers/README.md create mode 100644 examples/headers/requirements.txt create mode 100644 examples/inputs-update/README.md create mode 100644 examples/inputs-update/requirements.txt create mode 100644 examples/load_balance/README.md create mode 100644 examples/load_balance/requirements.txt create mode 100644 examples/model-score/README.md create mode 100644 examples/moduleapp/README.md create mode 100644 examples/moduleapp/requirements.txt create mode 100644 examples/penguins/README.md create mode 100644 examples/req/README.md create mode 100644 examples/req/requirements.txt create mode 100644 examples/static_plots/README.md create mode 100644 examples/static_plots/requirements.txt create mode 100644 examples/typed_inputs/README.md create mode 100644 examples/typed_inputs/requirements.txt create mode 100644 examples/ui-func/README.md create mode 100644 examples/ui-func/requirements.txt diff --git a/examples/airmass/README.md b/examples/airmass/README.md new file mode 100644 index 000000000..135269eb0 --- /dev/null +++ b/examples/airmass/README.md @@ -0,0 +1,3 @@ +## Airmass app + + diff --git a/examples/annotation-export/README.md b/examples/annotation-export/README.md new file mode 100644 index 000000000..dc68b756b --- /dev/null +++ b/examples/annotation-export/README.md @@ -0,0 +1,3 @@ +## Plot annotation app + + diff --git a/examples/annotation-export/requirements.txt b/examples/annotation-export/requirements.txt index 4695c7070..6a921d305 100644 --- a/examples/annotation-export/requirements.txt +++ b/examples/annotation-export/requirements.txt @@ -1,2 +1,4 @@ seaborn pandas +shiny +matplotlib diff --git a/examples/brownian/README.md b/examples/brownian/README.md new file mode 100644 index 000000000..d2b531f43 --- /dev/null +++ b/examples/brownian/README.md @@ -0,0 +1 @@ +## Hand-driven data exploration app diff --git a/examples/busy_indicators/README.md b/examples/busy_indicators/README.md new file mode 100644 index 000000000..bfea496a6 --- /dev/null +++ b/examples/busy_indicators/README.md @@ -0,0 +1,3 @@ +## Busy indicators app + + diff --git a/examples/busy_indicators/requirements.txt b/examples/busy_indicators/requirements.txt new file mode 100644 index 000000000..8cc6a66a2 --- /dev/null +++ b/examples/busy_indicators/requirements.txt @@ -0,0 +1,3 @@ +numpy +seaborn +shiny diff --git a/examples/chat/RAG/recipes/requirements.txt b/examples/chat/RAG/recipes/requirements.txt new file mode 100644 index 000000000..54b14a013 --- /dev/null +++ b/examples/chat/RAG/recipes/requirements.txt @@ -0,0 +1,4 @@ +aiohttp +bs4 +openai +shiny diff --git a/examples/chat/README.md b/examples/chat/README.md index c5a366394..b0c2f4907 100644 --- a/examples/chat/README.md +++ b/examples/chat/README.md @@ -1,5 +1,21 @@ # Shiny `Chat` examples + This folder contains a collection of examples illustrating `shiny.ui.Chat` usage. Many of them require API keys from providers such as OpenAI, Anthropic, etc. In those cases, the example should have commentary explaining how to obtain keys as well as how to provide them to the app. To get started with an app that doesn't require an API key, see the `hello-world` example. This example has both a Shiny Core and Express app to illustrate how it's used in either mode. + + +----------------------- + +## Apps + +* [hello-world](hello-world): A simple chat app that echoes back the user's input. +* [playground](playground): A playground for testing out different chat models: `openai`, `claude`, and `google`. +* RAG + * [recipes](RAG/recipes): A simple recipe extractor chatbot that extracts recipes from URLs using the OpenAI API. +* UI + * [clear](ui/clear): This example demonstrates how to clear the chat when the model changes. + * [dark](ui/dark): This example demonstrates Shiny Chat's dark mode capability. + * [dynamic](ui/dynamic): A basic example of dynamically re-rendering a Shiny Chat instance with different models. + * [sidebar](ui/sidebar): An example of placing a Shiny Chat instance in a sidebar (and having it fill the sidebar). diff --git a/examples/chat/hello-world/requirements.txt b/examples/chat/hello-world/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/chat/hello-world/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/chat/playground/requirements.txt b/examples/chat/playground/requirements.txt new file mode 100644 index 000000000..29bb799b8 --- /dev/null +++ b/examples/chat/playground/requirements.txt @@ -0,0 +1,4 @@ +langchain_anthropic +langchain_google_vertexai +langchain_openai +shiny diff --git a/examples/chat/ui/clear/requirements.txt b/examples/chat/ui/clear/requirements.txt new file mode 100644 index 000000000..74bdc42cd --- /dev/null +++ b/examples/chat/ui/clear/requirements.txt @@ -0,0 +1,2 @@ +langchain_openai +shiny diff --git a/examples/chat/ui/dark/requirements.txt b/examples/chat/ui/dark/requirements.txt new file mode 100644 index 000000000..74bdc42cd --- /dev/null +++ b/examples/chat/ui/dark/requirements.txt @@ -0,0 +1,2 @@ +langchain_openai +shiny diff --git a/examples/chat/ui/dynamic/requirements.txt b/examples/chat/ui/dynamic/requirements.txt new file mode 100644 index 000000000..74bdc42cd --- /dev/null +++ b/examples/chat/ui/dynamic/requirements.txt @@ -0,0 +1,2 @@ +langchain_openai +shiny diff --git a/examples/chat/ui/sidebar/requirements.txt b/examples/chat/ui/sidebar/requirements.txt new file mode 100644 index 000000000..74bdc42cd --- /dev/null +++ b/examples/chat/ui/sidebar/requirements.txt @@ -0,0 +1,2 @@ +langchain_openai +shiny diff --git a/examples/cpuinfo/README.md b/examples/cpuinfo/README.md new file mode 100644 index 000000000..69defb255 --- /dev/null +++ b/examples/cpuinfo/README.md @@ -0,0 +1,3 @@ +## CPU usage app + + diff --git a/examples/cpuinfo/requirements.txt b/examples/cpuinfo/requirements.txt new file mode 100644 index 000000000..91b6de986 --- /dev/null +++ b/examples/cpuinfo/requirements.txt @@ -0,0 +1,5 @@ +matplotlib +numpy +pandas +psutil +shiny diff --git a/examples/dataframe/README.md b/examples/dataframe/README.md new file mode 100644 index 000000000..629d00a93 --- /dev/null +++ b/examples/dataframe/README.md @@ -0,0 +1,3 @@ +## Data frame viewer + + diff --git a/examples/dataframe/requirements.txt b/examples/dataframe/requirements.txt new file mode 100644 index 000000000..4702dcbc4 --- /dev/null +++ b/examples/dataframe/requirements.txt @@ -0,0 +1,4 @@ +pandas +seaborn +shiny +shinyswatch diff --git a/examples/duckdb/README.md b/examples/duckdb/README.md new file mode 100644 index 000000000..6a66eb541 --- /dev/null +++ b/examples/duckdb/README.md @@ -0,0 +1,3 @@ +## DuckDB query weather explorer + + diff --git a/examples/duckdb/requirements.txt b/examples/duckdb/requirements.txt index 71bb3d1d9..4eb669cd9 100644 --- a/examples/duckdb/requirements.txt +++ b/examples/duckdb/requirements.txt @@ -1,4 +1,4 @@ duckdb +pandas shiny shinyswatch -pandas diff --git a/examples/event/README.md b/examples/event/README.md new file mode 100644 index 000000000..679f6d62e --- /dev/null +++ b/examples/event/README.md @@ -0,0 +1,3 @@ +## Sync / Async events + + diff --git a/examples/event/requirements.txt b/examples/event/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/event/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/express/README.md b/examples/express/README.md new file mode 100644 index 000000000..ab7a3151e --- /dev/null +++ b/examples/express/README.md @@ -0,0 +1,33 @@ +## `shiny.express` examples + +This folder contains a collection of examples illustrating `shiny.express` usage. + +### Apps + +* [`accordion_app.py`](accordion_app.py): + * Integrates `ui.accordion()` and `ui.accordion_panel()`. + +* [`basic_app.py`](basic_app.py): + * Basic app containing a `ui.input_slider()` and `ui.output_code()`. + +* [`column_wrap_app.py`](basic_app.py): + * Basic app containing a `ui.input_slider()` and `ui.output_code()`. + +* [`expressify_app.py`](expressify_app.py): + * Demonstrates how to use `@expressify` to convert regular functions into _express_ compatible functions. + +* [`hold_app.py`](hold_app.py): + * Demonstrates how to use `@hold` to prevent the app from updating. + +* [`nav_app.py`](nav_app.py): + * Demonstrates how to use different navsets along with `ui.nav_panel()`. + +* [`plot_app.py`](plot_app.py): + * Demonstrates how plot render methods are rendered in place. + +* [`render_express_app.py`](render_express_app.py): + * Demonstrates how to use `@render.express()` (similar to `@render.ui()`), but for _express_ functions. + +* [`shared_app.py`](shared_app.py): + * This app demonstrates how to use "global" variables that are shared across sessions. + * This is useful if you want to load data just once and use it in multiple apps, or if you want to share data or reactives among apps. diff --git a/examples/express/hold_app.py b/examples/express/hold_app.py index e64c29490..b692f195d 100644 --- a/examples/express/hold_app.py +++ b/examples/express/hold_app.py @@ -25,4 +25,4 @@ def txt(): ui.input_slider("n", "N", 1, 100, 50) -shiny.ui.output_code("txt", inline=True) +shiny.ui.output_code("txt") diff --git a/examples/express/requirements.txt b/examples/express/requirements.txt new file mode 100644 index 000000000..b079970cd --- /dev/null +++ b/examples/express/requirements.txt @@ -0,0 +1,3 @@ +matplotlib +numpy +shiny diff --git a/examples/global_pyplot/README.md b/examples/global_pyplot/README.md new file mode 100644 index 000000000..39a635c47 --- /dev/null +++ b/examples/global_pyplot/README.md @@ -0,0 +1,3 @@ +## Plotting with `matplotlib.pyplot` + + diff --git a/examples/global_pyplot/requirements.txt b/examples/global_pyplot/requirements.txt new file mode 100644 index 000000000..400f73f5f --- /dev/null +++ b/examples/global_pyplot/requirements.txt @@ -0,0 +1,2 @@ +matplotlib +shiny diff --git a/examples/headers/README.md b/examples/headers/README.md new file mode 100644 index 000000000..2dddf3be0 --- /dev/null +++ b/examples/headers/README.md @@ -0,0 +1,3 @@ +## HTTP request headers app + + diff --git a/examples/headers/requirements.txt b/examples/headers/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/headers/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/inputs-update/README.md b/examples/inputs-update/README.md new file mode 100644 index 000000000..ac9c8c9d1 --- /dev/null +++ b/examples/inputs-update/README.md @@ -0,0 +1,3 @@ +## Updating shiny inputs + + diff --git a/examples/inputs-update/requirements.txt b/examples/inputs-update/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/inputs-update/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/load_balance/README.md b/examples/load_balance/README.md new file mode 100644 index 000000000..495d3da59 --- /dev/null +++ b/examples/load_balance/README.md @@ -0,0 +1,3 @@ +## Sticky load balance test app + + diff --git a/examples/load_balance/requirements.txt b/examples/load_balance/requirements.txt new file mode 100644 index 000000000..71022f994 --- /dev/null +++ b/examples/load_balance/requirements.txt @@ -0,0 +1,2 @@ +shiny +starlette diff --git a/examples/model-score/README.md b/examples/model-score/README.md new file mode 100644 index 000000000..45205eceb --- /dev/null +++ b/examples/model-score/README.md @@ -0,0 +1,3 @@ +## Model monitoring dashboard + + diff --git a/examples/model-score/requirements.txt b/examples/model-score/requirements.txt index 1a5617b60..a87615d6d 100644 --- a/examples/model-score/requirements.txt +++ b/examples/model-score/requirements.txt @@ -1,3 +1,4 @@ +numpy pandas plotly shiny diff --git a/examples/moduleapp/README.md b/examples/moduleapp/README.md new file mode 100644 index 000000000..45205eceb --- /dev/null +++ b/examples/moduleapp/README.md @@ -0,0 +1,3 @@ +## Model monitoring dashboard + + diff --git a/examples/moduleapp/requirements.txt b/examples/moduleapp/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/moduleapp/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/penguins/README.md b/examples/penguins/README.md new file mode 100644 index 000000000..b16135304 --- /dev/null +++ b/examples/penguins/README.md @@ -0,0 +1,3 @@ +## Penguins dashboard + + diff --git a/examples/penguins/requirements.txt b/examples/penguins/requirements.txt index 14d67b478..35f60813f 100644 --- a/examples/penguins/requirements.txt +++ b/examples/penguins/requirements.txt @@ -1,4 +1,4 @@ -shiny -shinyswatch +matplotlib pandas seaborn +shiny diff --git a/examples/req/README.md b/examples/req/README.md new file mode 100644 index 000000000..7fb618939 --- /dev/null +++ b/examples/req/README.md @@ -0,0 +1,3 @@ +## Error handling example app + + diff --git a/examples/req/requirements.txt b/examples/req/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/req/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/static_plots/README.md b/examples/static_plots/README.md new file mode 100644 index 000000000..94baf664a --- /dev/null +++ b/examples/static_plots/README.md @@ -0,0 +1,3 @@ +## Static Plots + + diff --git a/examples/static_plots/requirements.txt b/examples/static_plots/requirements.txt new file mode 100644 index 000000000..dcb817f56 --- /dev/null +++ b/examples/static_plots/requirements.txt @@ -0,0 +1,6 @@ +matplotlib +numpy +pandas +seaborn +plotnine +shiny diff --git a/examples/typed_inputs/README.md b/examples/typed_inputs/README.md new file mode 100644 index 000000000..91d2d6704 --- /dev/null +++ b/examples/typed_inputs/README.md @@ -0,0 +1,3 @@ +## Typed inputs + + diff --git a/examples/typed_inputs/requirements.txt b/examples/typed_inputs/requirements.txt new file mode 100644 index 000000000..3e78250b6 --- /dev/null +++ b/examples/typed_inputs/requirements.txt @@ -0,0 +1 @@ +shiny diff --git a/examples/ui-func/README.md b/examples/ui-func/README.md new file mode 100644 index 000000000..0b4fd38cf --- /dev/null +++ b/examples/ui-func/README.md @@ -0,0 +1,3 @@ +## UI as a function + + diff --git a/examples/ui-func/requirements.txt b/examples/ui-func/requirements.txt new file mode 100644 index 000000000..71022f994 --- /dev/null +++ b/examples/ui-func/requirements.txt @@ -0,0 +1,2 @@ +shiny +starlette