How to share Dash apps without deploying them

There is a magical feature in uv, which allows you run remote scripts hosted online. As a consequence, you can have the app code in a file online, and simply run:

uv run https://example.com/my_script.py

Then uv will:

:large_blue_circle: Temporarily download the script
:large_blue_circle: Create a virtual environment using the inline metadata (Python version and package dependencies)
:large_blue_circle: Activate the environment
:large_blue_circle: Run the Python code

Even with a non-technical audience, you can guide them to install uv (30 seconds), and share the uv run... command.

You can keep updating the online version, and they can periodically check the changes.

You can include data files (also online), by slightly modifying your code. For example:

import pandas as pd
df = pd.read_csv("https://raw.githubusercontent.com/user/repo/data.csv")

Hope you find it useful!

Nice!
Thanks for sharing. I can see at least one use case for my own needs.

What is your experience on uv, does it indeed replaces pip without drawbacks?

1 Like

Thanks @spriteware !

I haven’t seen any drawbacks to using uv instead of pip. Maybe there are but I’m not aware of them yet.

They have pretty much all the API available as a drop-in replacement uv pip install , uv pip uninstall, etc. It also has the pip-tools functionality, uv pip compile and uv pip sync.

1 Like