Rayport
Package Python raylib games as static files that run in a web browser.
Rayport includes the browser runtime needed to package a game. You do not need a separate raylib installation or compiler.
Installation
Install Rayport as an isolated command-line tool:
uv tool install rayport
or:
pipx install rayport
Rayport requires Python 3.13 or newer. Python 3.13 and 3.14 are tested.
Quick start
Your game directory must contain main.py:
my-game/
├── main.py
└── assets/
Start a local server with automatic rebuilding:
rayport dev ./my-game
Create a static web build:
rayport build ./my-game --output dist
Upload the contents of dist/ to a static web server. The generated game must
be served over HTTP or HTTPS; opening index.html directly with file:// is not
supported.
Commands
Check the installed version:
rayport --version
See which files will be packaged:
rayport inspect ./my-game
rayport inspect ./my-game --excluded
rayport inspect ./my-game --explain tests/test_game.py
rayport inspect ./my-game --sizes
Rayport marks generated directories with .rayport-output. It will not replace
an unrelated non-empty directory unless you explicitly pass --force-output.
Run rayport COMMAND --help for every available option.
Project configuration
Place rayport.toml in the game directory:
config-version = 1
[web]
title = "My Game"
presentation = "stretch"
background = "#1a1a2e"
[package]
exclude = [
"tests/**",
"debug/**",
"demo/**",
"screenshots/**",
]
include = []
Presentation modes:
stretchfills the browser viewport.fitpreserves the game's aspect ratio.pixel-perfectuses integer scaling when possible.nativedisplays one CSS pixel per game pixel.
The game controls its render resolution through InitWindow(). Command-line
options override rayport.toml, which overrides Rayport defaults.
Packaging behavior
main.pyis required.- Hidden paths, virtual environments, caches,
node_modules,build, andrayport.tomlare excluded by default. - Images, audio, and other assets are packaged without conversion.
- Symbolic links, FIFOs, sockets, devices, and other non-regular files are rejected when they would be included.
- Rayport follows imports reachable from
main.pyand copies required pure Python packages from the game's.venvorvenv. - Install the game's dependencies before building. Missing packages are reported during the build instead of failing later in the browser.
- Native extension files such as
.soand.pydare skipped because they cannot run in the WebAssembly runtime. Packages with a pure Python fallback, including PyYAML, can still work. - Dependency versions, skipped native files, and available license files are
recorded inside
game.tar.gzunder.rayport/.
Compatibility
- Rayport CLI: Python 3.13 and 3.14 tested on Linux, macOS, and Windows.
- Browser runtime: CPython 3.12.11 and raylib 5.5.
- Browser: Chromium is tested automatically.
- Firefox and Safari have not been verified yet.
Because the browser runtime uses CPython 3.12, game code must be compatible with Python 3.12 even when the Rayport CLI runs on a newer Python version.
License
Rayport is licensed under the Eclipse Public License 2.0. Generated builds include Rayport and third-party license notices. The license does not apply to independent game code merely packaged by Rayport.
See the third-party notices for additional information.
Release files for rayport 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rayport-0.3.1.tar.gz | 7.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rayport-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 MB
Release files / rayport-0.3.1.tar.gz
| Download URL | rayport-0.3.1.tar.gz |
|---|---|
| Size | 7.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82eecfdae5f5a7397c7497eca44e44abe356e894694254aa4cb5d2630228a0ca
|
|
BLAKE2b-256 checksum How to use checksums |
7f7f12b28e79a4d6204f5d2c9d2b3368f0b7b9b06e3fe81cc4a206c164f6a1b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.
Transparency logRelease files / rayport-0.3.1-py3-none-any.whl
| Download URL | rayport-0.3.1-py3-none-any.whl |
|---|---|
| Size | 7.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4be24ea5f2887ebce8bb5a563820efae358d2fa155a89bf123c4bc27d2b2009
|
|
BLAKE2b-256 checksum How to use checksums |
58cc0fa6f5b9617a1f837ee037a23e411a93bba90a8f758c379f17f78c0503a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.
Transparency log