Skip to content

Add Streamlit to PythonExtention #953

@tommasodotNET

Description

@tommasodotNET

Related to an existing integration?

Yes

Existing integration

CommunityToolkit.Aspire.Hosting.Python.Extensions

Overview

We should add support in the Python Extension for streamlit. The extension is basically a wrapper around AddExecutable with the hardcoded command streamlit. A streamlit app is executed by running
streamlit run your_file.py, so we want to probably use the same structure we use for golang.

Usage example

The first parameter is of course the aspire resource name. Second param is the working directory and third param is the python file to be run by streamlit.

builder.AddStreamlitApp("myapp", "../path/to/app", "app.py")
    .WithHttpEndpoint(env: "PORT")
    .WithHttpHealthCheck("/health");

Breaking change?

No

Alternatives

You can use AddExecutable to manually set the commands.

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions