Skip to main content

Modern replacement for pygbag that leverages pyodide for running pygame in the web

Project description

pygodide

BETA (Everything is subject to change)

Pronounced "pie-go-died", pygodide is a tool for converting pygame projects into web applications using Pyodide. It provides a simple command line interface and works by analyzing your code and asset files and then building them together with some web-specific glue code to make everything work in the browser.

Thanks to Pyodide, pygodide supports far more Python packages than just pygame.

Install

pip install pygodide
git clone https://github.com/Elan456/pygodide.git
cd pygodide
uv sync --dev

Quick Start

pygodide build /path/to/your/pygame/project --serve

That's it! Open http://localhost:8000 in a web browser to see your app running. Currently only supports flat projects. The vision is to support any arbitrary pygame project.

Development

Install the local hooks once after cloning:

uv run pre-commit install --hook-type pre-commit --hook-type pre-push

Run the same checks as CI locally:

uv run ruff format --check .
uv run ruff check .
uv run pytest

Proof of Concept

test_targets/ball_bouncing contains a small Pygame app.

Using the following command, you can build and serve the app in a web browser:

pygodide build test_targets/ball_bouncing/src --serve

You'll get the output of:

Serving /home/ethan/Projects/pygodide/test_targets/ball_bouncing/build at http://localhost:8000

Open http://localhost:8000 in a web browser to see the app running. You should see a bouncing ball! Press the arrow keys to accelerate the ball in different directions.

Project details


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.0b1.tar.gz (5.5 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.0b1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygodide-0.1.0b1.tar.gz
  • Upload date:
  • Size: 5.5 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.0b1.tar.gz
Algorithm Hash digest
SHA256 ad6931c6de8226f0cff32d56e97fb054964faa6912f04de4c17f63dfc99896b0
MD5 8b9d07d44210769115d5d378b8007110
BLAKE2b-256 f507f1322fec6803148d7265e52ec7201442325aac82d0e54c75ea94c1a08958

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygodide-0.1.0b1.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.0b1-py3-none-any.whl.

File metadata

  • Download URL: pygodide-0.1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 118e8f1b673ebf675371e8611cb4f4a41c1dc6a9bad17bc432c1f6f4e264588f
MD5 1867bdf212493238d6b4569906472744
BLAKE2b-256 d5787aec7bfebfb5cfac4b8364a2dc77736aff4ec9b60af100a90e1d71aa624f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygodide-0.1.0b1-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 Pingdom Monitoring Sentry Error logging StatusPage Status page