Metadata-Version: 2.4
Name: pygodide
Version: 0.1.0b15
Summary: Turn Pygame projects into browser apps with Pyodide
Project-URL: Homepage, https://github.com/Elan456/pygodide
Project-URL: Documentation, https://elan456.github.io/pygodide/
Project-URL: Repository, https://github.com/Elan456/pygodide.git
Project-URL: Issues, https://github.com/Elan456/pygodide/issues
Project-URL: Changelog, https://github.com/Elan456/pygodide/releases
Author-email: Ethan Anderson <telan4892@gmail.com>
License: MIT
License-File: LICENSE
Keywords: browser,build-tool,cli,emscripten,game,gamedev,html5,html5-game,itch.io,packaging,pygame,pygame-ce,pygodide,pyodide,wasm,web,webassembly
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: jinja2>=3.1.6
Requires-Dist: packaging>=23.1
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: typer>=0.27.0
Provides-Extra: smoke
Requires-Dist: playwright>=1.57.0; extra == 'smoke'
Description-Content-Type: text/markdown

<h1 align="left">
  <img src="docs/assets/images/pygodide-logo.svg" alt="pygodide" width="440">
</h1>

[![PyPI](https://img.shields.io/pypi/v/pygodide.svg)](https://pypi.org/project/pygodide/)
[![Python versions](https://img.shields.io/pypi/pyversions/pygodide.svg)](https://pypi.org/project/pygodide/)
[![Downloads](https://static.pepy.tech/personalized-badge/pygodide?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=BLUE&left_text=Total%20Downloads)](https://pepy.tech/projects/pygodide)
[![CI](https://github.com/Elan456/pygodide/actions/workflows/ci.yml/badge.svg)](https://github.com/Elan456/pygodide/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/pypi/l/pygodide.svg)](LICENSE)

[![Docs](https://img.shields.io/badge/docs-online-brightgreen)](https://elan456.github.io/pygodide/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

**pygodide** turns Pygame projects into browser apps
using [Pyodide](https://pyodide.org/) with one command, no edits to your source code, and achieving [2.5x more FPS than pygbag](https://elan456.github.io/pygodide/benchmark/) (in certain cases).

> Pronounced "pie-go-died"

<p align="center">
  <img
    src="docs/assets/images/loading-screen.gif"
    alt="pygodide in-browser loading screen, then a pygame snake game starting"
    width="49%"
  >
  <a href="https://elan456.github.io/pygodide/benchmark/">
    <img
      src="docs/assets/images/benchmark-readme.png"
      alt="FPS benchmark: pygodide 453 vs pygbag 180 on perf_bench"
      width="49%"
    >
  </a>
</p>
<p align="center">
  <sub> Loading screen | 
    <a href="https://elan456.github.io/pygodide/benchmark/">FPS vs pygbag </a>
  </sub>
</p>

[![Documentation](https://img.shields.io/badge/Documentation-Read%20the%20docs-e8c200?style=for-the-badge&labelColor=275a86&color=e8c200)](https://elan456.github.io/pygodide/)

## Quick Start

From your project's root directory, run the following commands:

### Install

```bash
# Or add to your pyproject.toml and `uv sync`
pip install pygodide
```

### Build

```bash
# Produces the web-hostable build/ directory
pygodide build .

# For an itch.io zip file
pygodide build . --zip
```

### Serve

```bash
# Hosts the build/ directory locally
pygodide serve .
```

Open [http://localhost:8000](http://localhost:8000) in your browser.

### Troubleshooting

If anything went wrong, work through the
[instructions](https://elan456.github.io/pygodide/instructions/) page first
(config, async, smoke tests, and common failures).

If you still cannot get your game running in the browser, open a
[**"My project didn't convert"** issue](https://github.com/Elan456/pygodide/issues/new?template=conversion-failure.yml)
so we can improve pygodide for everyone. Paste `build/pygodide-build.log` into
the form.

## Examples and Live Demos

Sample projects live under
[`test_targets/`](https://github.com/Elan456/pygodide/tree/main/test_targets), and a few of them are uploaded to itch.io.

- [3D first-person demo](https://elan456.itch.io/pygodide-pyvorengi-sdk-demo)
- [Numpy particles demo](https://elan456.itch.io/pygodide-test-project)
- [Audio demo](https://elan456.itch.io/pygodide-audio-demo)
- [Arcade performance benchmark](https://elan456.itch.io/pygodide-performance-benchmark)

Try one locally:

```bash
git clone https://github.com/Elan456/pygodide.git
cd pygodide
pip install pygodide

pygodide build test_targets/ball_bouncing
pygodide serve test_targets/ball_bouncing
```

Before every release, each target under `test_targets/` is automatically verified using a headless browser to catch regressions. All features shown in the test targets are maintained as first-class features.

## Contributing

```bash
git clone https://github.com/Elan456/pygodide.git
cd pygodide
uv sync --dev
uv run playwright install chromium
uv run pre-commit install --hook-type pre-commit --hook-type pre-push
```

The `dev` group includes `pygodide[smoke]`, so Playwright is installed with
`uv sync --dev`. You still need `playwright install chromium` once for browser
binaries.

Run the same checks as CI:

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

### Smoke tests (from this repo)

```bash
uv run playwright install chromium   # once
uv run pygodide smoke /path/to/your/pygame/project
uv run pygodide smoke test_targets --suite
```

Be sure to read `AGENTS.md`; it is written for both human contributors and AI tools.
