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.0b2.tar.gz (33.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.0b2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pygodide-0.1.0b2.tar.gz
  • Upload date:
  • Size: 33.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.0b2.tar.gz
Algorithm Hash digest
SHA256 9341493cabb5351eabf95c03ef0e08304eb1e9063929feb2cb60de89355483d8
MD5 ec416401c51e3c0345cc2435fe6f7838
BLAKE2b-256 7ec3a6a304cc29a4335ceb8957628559d6bff82fae162b75c594c506d7204dd1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygodide-0.1.0b2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e4aee453775f58a65200ab6eaf83ccf2aafe5029e5c7c139746dc032336b724
MD5 486cd9503e4c56411b03bc03fe1879e5
BLAKE2b-256 eb814c690cc62111ffe9480009007bef0a9f4ca42ab739219f69412b89a97787

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygodide-0.1.0b2-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