Skip to main content
Pre-release

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/:

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 pygodide smoke test_targets --suite

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygodide-0.1.0b4.tar.gz (106.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygodide-0.1.0b4-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file pygodide-0.1.0b4.tar.gz.

File metadata

  • Download URL: pygodide-0.1.0b4.tar.gz
  • Upload date:
  • Size: 106.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygodide-0.1.0b4.tar.gz
Algorithm Hash digest
SHA256 ae72a3da08b923b83cffd30cbf699b826bc626a1d602c772d6bd1eb05acdb5e5
MD5 b5b6bfb842aa0b484fbbd57c094258f4
BLAKE2b-256 dd332b9dec0f2bbf722f2555e7ee005ad56e9cbdf052c43fb9a7d88fa84417e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygodide-0.1.0b4.tar.gz:

Publisher: publish.yml on Elan456/pygodide

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygodide-0.1.0b4-py3-none-any.whl.

File metadata

  • Download URL: pygodide-0.1.0b4-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

Hashes for pygodide-0.1.0b4-py3-none-any.whl
Algorithm Hash digest
SHA256 c372486105617f754129a4839dc6d5da7f60a4bfcca1479b9d4fc3a80dbff357
MD5 93feeed2298963adb4ddb31febfee156
BLAKE2b-256 6372a0c295c47fb3a81a4ac91af88c048c0d836d76484b3ce312cbd08f72943b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygodide-0.1.0b4-py3-none-any.whl:

Publisher: publish.yml on Elan456/pygodide

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page