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
Release history Release notifications | RSS feed
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.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9341493cabb5351eabf95c03ef0e08304eb1e9063929feb2cb60de89355483d8
|
|
| MD5 |
ec416401c51e3c0345cc2435fe6f7838
|
|
| BLAKE2b-256 |
7ec3a6a304cc29a4335ceb8957628559d6bff82fae162b75c594c506d7204dd1
|
Provenance
The following attestation bundles were made for pygodide-0.1.0b2.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.0b2.tar.gz -
Subject digest:
9341493cabb5351eabf95c03ef0e08304eb1e9063929feb2cb60de89355483d8 - Sigstore transparency entry: 1893519195
- Sigstore integration time:
-
Permalink:
Elan456/pygodide@984e398f6704514812af5b23804171a01fe874ea -
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@984e398f6704514812af5b23804171a01fe874ea -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e4aee453775f58a65200ab6eaf83ccf2aafe5029e5c7c139746dc032336b724
|
|
| MD5 |
486cd9503e4c56411b03bc03fe1879e5
|
|
| BLAKE2b-256 |
eb814c690cc62111ffe9480009007bef0a9f4ca42ab739219f69412b89a97787
|
Provenance
The following attestation bundles were made for pygodide-0.1.0b2-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.0b2-py3-none-any.whl -
Subject digest:
6e4aee453775f58a65200ab6eaf83ccf2aafe5029e5c7c139746dc032336b724 - Sigstore transparency entry: 1893519335
- Sigstore integration time:
-
Permalink:
Elan456/pygodide@984e398f6704514812af5b23804171a01fe874ea -
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@984e398f6704514812af5b23804171a01fe874ea -
Trigger Event:
workflow_dispatch
-
Statement type: