How to Share Panel Scripts with uv
Transform your Panel applications into portable, shareable scripts that anyone can run with a single command using uv.
This approach eliminates dependency management headaches and makes your Panel apps accessible to colleagues, collaborators, and the broader community.
What You'll Accomplish
By the end of this guide, you'll have:
Created a self-contained Panel script with embedded dependencies
Configured the script for both local development and sharing
Published your script for others to run directly from GitHub
Prerequisites
uv installed: Install from astral.sh/uv
Basic Panel knowledge: Familiarity with creating Panel applications
Git/GitHub account: For sharing your scripts publicly
Step 1: Create a Self-Contained Panel Script
Create a new file called script.py with a complete Panel application:
Why this structure works:
The dual-mode execution allows flexible running with either
python script.pyorpanel serve script.pyClear component organization makes the code maintainable
Descriptive names and comments aid understanding
Step 2: Add Dependency Metadata
Configure your script's Python version and dependencies using uv's inline metadata feature:
This command automatically adds a metadata block to your script:
Pro tip: Add additional dependencies as needed:
Step 3: Test Locally
Verify your script works in an isolated environment:
The --dev flag enables auto-reload during development, and --show automatically opens your browser.
Step 4: Publish to GitHub
Make your script accessible to others by publishing it:
Create a repository or use an existing one
Commit your script:
Get the raw file URL from GitHub (click "Raw" button on the file page)
Step 5: Share and Run from Anywhere
Others can now run your script directly from GitHub:
For example try running examples/apps/uv/app.py:
Advanced Sharing Patterns
GitHub Gists
For quick sharing without a full repository create a public gist and run it directly:
Your Panel applications are now portable, shareable, and ready for collaboration!
For more tips and tricks, check out the uv | Running Scripts guide.