Export Python Apps as a Single HTML File
PyCafe makes it easy to distribute Python‑powered applications by exporting them as a single self‑contained HTML file.
This standalone file:
- includes your code, UI, and datasets (up to 400 MB)
- Runs entirely in the browser
- Requires no server, no installation, and no deployment
You can share the exported file via email, chat, cloud storage, or any other channel, and your colleagues or clients can open it instantly in Edge, Chrome and Firefox.

There are two ways to export your project as a single HTML file:
1. Export from the PyCafe GUI
- Open your project in PyCafe.
- Click Share.
- Select tab Export.
- Click Download as HTML.
PyCafe will produce a single .html file ready to download and distribute.

Note:
• On the free hosted service https://py.cafe, the maximum project size is 10 MB. Use the command line method below for larger projects.• On self‑hosted instances, exports can be up to 400 MB.
2. Export from the Command Line
You can also export a directory containing app.py, requirements.txt, and any data files into a standalone HTML file.
2.1 Using a Self-Hosted PyCafe Server
First, set the following environment variables:
export PYCAFE_API_KEY=hlU[...]Blkg
export PYCAFE_CLIENT_URL=https://your-pycafe-domain.comThe client token can be obtained from the admin page at https://your-pycafe-domain.com/api-keys.
Then run:
uvx pycafe-server export-html \
--name myapp \
--source-dir \
--path/to/myapp \
--pyodide 0.27.2 \
--type vziroThis will generate myapp.html in the current directory.
Using pip instead of uvx:
pip install pycafe-server
pycafe-server export-html \
--name myapp \
--source-dir \
--path/to/myapp \
--pyodide 0.27.2 \
--type vziro2.2 Using the Public PyCafe Instance (https://py.cafe)
When using the public PyCafe service, you do not need an API key or server URL.
Instead, add the —public flag:
uvx pycafe-server export-html \
-- public \
--name myapp \
--source-dir \
--path/to/myapp \
--pyodide 0.27.2 \
--type vziroNote:
Even through the public PyCafe instance, command‑line exports support projects up to 400 MB.
Summary
| Export Method | Max Size | Requirements |
|---|---|---|
| GUI (https://py.cafe) | 10 MB | Browser only |
| GUI (self‑hosted) | 400 MB | Self‑hosted server |
| CLI (public or self‑hosted) | 400 MB | pycafe-server tool |
This makes PyCafe a flexible option for distributing Python‑powered web applications—no backend, no deployment, and no installation needed.