Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Deploy to Connect Cloud buttons to app READMEs #1709

Merged
merged 9 commits into from
Oct 2, 2024
3 changes: 3 additions & 0 deletions examples/airmass/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Airmass app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fairmass%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
3 changes: 3 additions & 0 deletions examples/annotation-export/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Plot annotation app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fannotation-export%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
2 changes: 2 additions & 0 deletions examples/annotation-export/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
seaborn
pandas
shiny
matplotlib
1 change: 1 addition & 0 deletions examples/brownian/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Hand-driven data exploration app
3 changes: 3 additions & 0 deletions examples/busy_indicators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Busy indicators app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fbusy_indicators%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
3 changes: 3 additions & 0 deletions examples/busy_indicators/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy
seaborn
shiny
4 changes: 4 additions & 0 deletions examples/chat/RAG/recipes/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
aiohttp
bs4
openai
shiny
16 changes: 16 additions & 0 deletions examples/chat/README.md
Original file line number Diff line number Diff line change
@@ -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).
1 change: 1 addition & 0 deletions examples/chat/hello-world/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
4 changes: 4 additions & 0 deletions examples/chat/playground/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
langchain_anthropic
langchain_google_vertexai
langchain_openai
shiny
2 changes: 2 additions & 0 deletions examples/chat/ui/clear/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
langchain_openai
shiny
2 changes: 2 additions & 0 deletions examples/chat/ui/dark/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
langchain_openai
shiny
2 changes: 2 additions & 0 deletions examples/chat/ui/dynamic/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
langchain_openai
shiny
2 changes: 2 additions & 0 deletions examples/chat/ui/sidebar/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
langchain_openai
shiny
3 changes: 3 additions & 0 deletions examples/cpuinfo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## CPU usage app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fcpuinfo%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
5 changes: 5 additions & 0 deletions examples/cpuinfo/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
matplotlib
numpy
pandas
psutil
shiny
3 changes: 3 additions & 0 deletions examples/dataframe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Data frame viewer

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fdataframe%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
4 changes: 4 additions & 0 deletions examples/dataframe/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pandas
seaborn
shiny
shinyswatch
3 changes: 3 additions & 0 deletions examples/duckdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## DuckDB query weather explorer

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fduckdb%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
2 changes: 1 addition & 1 deletion examples/duckdb/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
duckdb
pandas
shiny
shinyswatch
pandas
3 changes: 3 additions & 0 deletions examples/event/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Sync / Async events

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fevent%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/event/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
33 changes: 33 additions & 0 deletions examples/express/README.md
Original file line number Diff line number Diff line change
@@ -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): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Faccordion_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Integrates `ui.accordion()` and `ui.accordion_panel()`.

* [`basic_app.py`](basic_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fbasic_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Basic app containing a `ui.input_slider()` and `ui.output_code()`.

* [`column_wrap_app.py`](basic_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fbasic_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Basic app containing a `ui.input_slider()` and `ui.output_code()`.

* [`expressify_app.py`](expressify_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fexpressify_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Demonstrates how to use `@expressify` to convert regular functions into _express_ compatible functions.

* [`hold_app.py`](hold_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fhold_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Demonstrates how to use `@hold` to prevent the app from updating.

* [`nav_app.py`](nav_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fnav_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Demonstrates how to use different navsets along with `ui.nav_panel()`.

* [`plot_app.py`](plot_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fplot_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Demonstrates how plot render methods are rendered in place.

* [`render_express_app.py`](render_express_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Frender_express_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* Demonstrates how to use `@render.express()` (similar to `@render.ui()`), but for _express_ functions.

* [`shared_app.py`](shared_app.py): <a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fexpress%2Fshared_app.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' height="15px" /></a>
* 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.
2 changes: 1 addition & 1 deletion examples/express/hold_app.py
Original file line number Diff line number Diff line change
@@ -25,4 +25,4 @@ def txt():

ui.input_slider("n", "N", 1, 100, 50)

shiny.ui.output_code("txt", inline=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Reference: https://shiny.posit.co/py/api/core/ui.output_code.html

No inline argument

shiny.ui.output_code("txt")
3 changes: 3 additions & 0 deletions examples/express/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
matplotlib
numpy
shiny
3 changes: 3 additions & 0 deletions examples/global_pyplot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Plotting with `matplotlib.pyplot`

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fglobal_pyplot%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
2 changes: 2 additions & 0 deletions examples/global_pyplot/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
matplotlib
shiny
3 changes: 3 additions & 0 deletions examples/headers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## HTTP request headers app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fheaders%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/headers/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
3 changes: 3 additions & 0 deletions examples/inputs-update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Updating shiny inputs

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Finputs-update%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/inputs-update/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
3 changes: 3 additions & 0 deletions examples/load_balance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Sticky load balance test app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fload_balance%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
2 changes: 2 additions & 0 deletions examples/load_balance/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shiny
starlette
3 changes: 3 additions & 0 deletions examples/model-score/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Model monitoring dashboard

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fmodel-score%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/model-score/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
numpy
pandas
plotly
shiny
3 changes: 3 additions & 0 deletions examples/moduleapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Model monitoring dashboard

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fmodel-score%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/moduleapp/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
3 changes: 3 additions & 0 deletions examples/penguins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Penguins dashboard

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fpenguins%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
4 changes: 2 additions & 2 deletions examples/penguins/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
shiny
shinyswatch
matplotlib
pandas
seaborn
shiny
3 changes: 3 additions & 0 deletions examples/req/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Error handling example app

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Freq%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/req/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
3 changes: 3 additions & 0 deletions examples/static_plots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Static Plots

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fstatic_plots%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
6 changes: 6 additions & 0 deletions examples/static_plots/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
matplotlib
numpy
pandas
seaborn
plotnine
shiny
3 changes: 3 additions & 0 deletions examples/typed_inputs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Typed inputs

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Ftyped_inputs%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
1 change: 1 addition & 0 deletions examples/typed_inputs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shiny
3 changes: 3 additions & 0 deletions examples/ui-func/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## UI as a function

<a href='https://connect.posit.cloud/publish?framework=shiny&sourceRepositoryURL=https%3A%2F%2Fgithub.com%2Fposit-dev%2Fpy-shiny&sourceRef=main&sourceRefType=branch&primaryFile=examples%2Fui-func%2Fapp.py&pythonVersion=3.11'><img src='https://cdn.connect.posit.cloud/assets/deploy-to-connect-blue.svg' align="right" /></a>
2 changes: 2 additions & 0 deletions examples/ui-func/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shiny
starlette
Loading