-
Notifications
You must be signed in to change notification settings - Fork 157
Add Streamlit support to Python Extensions (Experimental) #954
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b5de556
Initial plan
Copilot 061bdaa
Add Streamlit support to Python Extensions
Copilot 282844c
Add PORT to STREAMLIT_SERVER_PORT environment variable mapping
Copilot d19ecb3
Add README for Streamlit example
Copilot 31c6448
Address review comments: remove .NET prefix and hardcode streamlit ex…
Copilot 0b68f84
Update src/CommunityToolkit.Aspire.Hosting.Python.Extensions/README.md
tommasodotNET 4b680f7
Update src/CommunityToolkit.Aspire.Hosting.Python.Extensions/Streamli…
tommasodotNET a739f4e
Merge branch 'main' into copilot/add-streamlit-support
aaronpowell 0e4a211
Update StreamlitApp to use Aspire.Hosting.Python integration and mark…
Copilot 5425af5
Merge branch 'main' into copilot/add-streamlit-support
aaronpowell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add README for Streamlit example
- Loading branch information
commit d19ecb32508dc5f75464df5c0e52852e72056127
There are no files selected for viewing
This file contains hidden or 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,57 @@ | ||
| # Streamlit API Example | ||
|
|
||
| This is a simple Streamlit application that demonstrates how to run Streamlit apps in .NET Aspire using the Python Extensions. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Python 3.12 or later | ||
| - .NET 8.0 or later | ||
| - Streamlit package | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Create a virtual environment: | ||
| ```bash | ||
| python -m venv .venv | ||
| ``` | ||
|
|
||
| 2. Activate the virtual environment: | ||
| - On Windows: | ||
| ```bash | ||
| .venv\Scripts\activate | ||
| ``` | ||
| - On macOS/Linux: | ||
| ```bash | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| 3. Install dependencies: | ||
| ```bash | ||
| pip install streamlit | ||
| ``` | ||
|
|
||
| ## Running the App | ||
|
|
||
| The app can be run as part of the Aspire AppHost project or standalone. | ||
|
|
||
| ### Run with Aspire | ||
|
|
||
| Navigate to the AppHost project and run: | ||
| ```bash | ||
| dotnet run | ||
| ``` | ||
|
|
||
| ### Run Standalone | ||
|
|
||
| From this directory, run: | ||
| ```bash | ||
| streamlit run app.py | ||
| ``` | ||
|
|
||
| ## About the App | ||
|
|
||
| This is a basic Streamlit app that demonstrates: | ||
| - Simple text display | ||
| - Environment variable reading (PORT) | ||
| - Session state management | ||
| - Interactive buttons | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.