This release is a pre-release and may not be stable for production use.
pygodide
BETA — everything is subject to change
Pronounced "pie-go-died", pygodide turns Pygame projects into browser apps using Pyodide. It bundles your code and assets, installs Python dependencies in the browser, and generates the HTML and JavaScript needed to run your game on the web.
Documentation: https://elan456.github.io/pygodide/
Install
pip install pygodide
Quick start
From your project root:
pygodide build .
pygodide serve .
Open http://localhost:8000 in your browser.
By default, pygodide looks for main() in main.py, reads dependencies from
requirements.txt or pyproject.toml, and auto-converts simple synchronous game
loops for the browser.
You can also build and serve in one step:
pygodide build . --serve
Use a different port with pygodide serve . --port 3000.
Full guide
The instructions cover troubleshooting, custom entry points, dependencies, manual async conversion, and smoke testing.
Common commands
| Command | What it does |
|---|---|
pygodide build . |
Bundle your project into build/ |
pygodide serve . |
Serve the built app locally (default port 8000) |
pygodide smoke . |
Build and test in a headless browser |
pygodide smoke . --verbose |
Show full build and smoke output on the console |
pygodide build . --app game:start |
Use a different entry function |
pygodide build . --dep numpy |
Add an extra dependency for this build |
pygodide build . --no-auto-async |
Disable automatic game-loop conversion |
Build output is logged to build/pygodide-build.log. Smoke tests also write
build/pygodide-smoke.log.
Examples
Sample projects live under
test_targets/:
- ball bouncing — minimal async Pygame game
- not async — sync loop converted automatically at build time
- numpy particles — larger game with extra dependencies
Try one locally:
pygodide build test_targets/ball_bouncing
pygodide serve test_targets/ball_bouncing
Developing
git clone https://github.com/Elan456/pygodide.git
cd pygodide
uv sync --dev
uv run pre-commit install --hook-type pre-commit --hook-type pre-push
Run the same checks as CI:
uv run ruff format --check .
uv run ruff check .
uv run pytest
Smoke tests
pygodide smoke builds an app and launches it in headless Chromium. End-user
projects do not need any extra manifest file.
uv run playwright install chromium
uv run pygodide smoke /path/to/your/pygame/project
The repository also maintains fixtures under test_targets/, each with a
testing_manifest.yaml. Run the full fixture suite with:
uv run playwright install chromium
./scripts/smoke
Use ./scripts/smoke --build-only to validate builds without a browser, or
./scripts/smoke --target ball-bouncing for a single fixture.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygodide-0.1.0b3.tar.gz.
File metadata
- Download URL: pygodide-0.1.0b3.tar.gz
- Upload date:
- Size: 106.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
794e9cc789ce7fca1b4775bfc089f8b7ac4bd0e602233b5fd5c848b367cdbf66
|
|
| MD5 |
2f4287b2bac9f57f765c1c2af273d5a3
|
|
| BLAKE2b-256 |
bed0925ab8046f343e096ee0c99d2f37739de3e486de2ebfe2395dc63527022a
|
Provenance
The following attestation bundles were made for pygodide-0.1.0b3.tar.gz:
Publisher:
publish.yml on Elan456/pygodide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygodide-0.1.0b3.tar.gz -
Subject digest:
794e9cc789ce7fca1b4775bfc089f8b7ac4bd0e602233b5fd5c848b367cdbf66 - Sigstore transparency entry: 2078367812
- Sigstore integration time:
-
Permalink:
Elan456/pygodide@60b9845cc4da98bb505a697baa47319aaab5e816 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Elan456
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60b9845cc4da98bb505a697baa47319aaab5e816 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pygodide-0.1.0b3-py3-none-any.whl.
File metadata
- Download URL: pygodide-0.1.0b3-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f032e06acca6e92e09bfef392ff2125358d9a059dbd8b222429a361c186ca01e
|
|
| MD5 |
c5e82f23eb23bca227b6e286f5929082
|
|
| BLAKE2b-256 |
69184ba819d5fbb47b3ea973bdd96426c4ceaa925901cfd9accb6f2b454a8c30
|
Provenance
The following attestation bundles were made for pygodide-0.1.0b3-py3-none-any.whl:
Publisher:
publish.yml on Elan456/pygodide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygodide-0.1.0b3-py3-none-any.whl -
Subject digest:
f032e06acca6e92e09bfef392ff2125358d9a059dbd8b222429a361c186ca01e - Sigstore transparency entry: 2078367891
- Sigstore integration time:
-
Permalink:
Elan456/pygodide@60b9845cc4da98bb505a697baa47319aaab5e816 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Elan456
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60b9845cc4da98bb505a697baa47319aaab5e816 -
Trigger Event:
workflow_dispatch
-
Statement type: