Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/VKSFY/keel/llms.txt

Use this file to discover all available pages before exploring further.

Keel is the backbone of your game. It combines a data-oriented archetype ECS, GPU-accelerated 2D and 3D rendering via ModernGL, physics simulation through pymunk and pybullet, audio via miniaudio, and a hot-reloading developer loop — all from Python. Install from PyPI as keelpy, import as keel, and be rendering a sprite in under twenty lines.

Installation

Install Keel from PyPI, choose optional extras for 3D physics and dev tooling, and verify your setup.

Quickstart

Build a moving sprite, add a bouncing ball with physics, and run your first Keel game in minutes.

ECS Concepts

Understand archetypes, components, queries, and how data flows through the world each frame.

API Reference

Explore the full public surface: App, World, Scheduler, components, physics, rendering, and more.

What Keel Provides

Keel is designed for developers who want to stay in Python and write structured game code on top of a real archetype-based ECS. Hot paths push work into numpy and C extensions (ModernGL, pymunk, pybullet) while the rest stays as plain Python.

Archetype ECS

Struct-of-arrays layout with numpy. Queries return column views, not copies.

2D Rendering

Instanced sprite batcher, texture atlas, orthographic camera, tilemap.

3D Rendering

OBJ loader, PBR-lite materials, directional + point lights, frustum culling.

Physics

2D via pymunk (rigid bodies, shapes, raycasts) and 3D via pybullet.

Audio

One-shot sound effects, streaming music, per-channel volume, fade in/out.

Hot Reload

keel run watches .py files and restarts the process on every save.

Get Started in 3 Steps

1

Install Keel

Install the keelpy package from PyPI. The import name is keel:
pip install keelpy
For 3D physics and developer tooling:
pip install "keelpy[physics3d,tools]"
2

Scaffold a new project

Use the CLI to create a project with the right directory layout and a working main.py:
keel new mygame
cd mygame
3

Run with hot reload

Start the dev loop. Save any .py file and the engine restarts automatically:
keel run

Minimal Example

A window with a white square you can move with WASD. texture_id=0 is always a 1×1 white pixel — no asset files needed to start.
main.py
import keel
from keel.renderer import setup_renderer_2d

app = keel.App(title="Hello Keel", width=800, height=600)
setup_renderer_2d(app)

@keel.component
class Player:
    speed: float = 200.0

app.world.spawn(
    keel.Transform2D(x=400.0, y=300.0),
    keel.Sprite(texture_id=0, width=32.0, height=32.0),
    Player(),
)

@app.system(keel.Phase.UPDATE)
def move(world, dt):
    for transform, player in world.query(keel.Transform2D, Player):
        if app.input.is_key_down(keel.KEY_D): transform['x'] += player['speed'] * dt
        if app.input.is_key_down(keel.KEY_A): transform['x'] -= player['speed'] * dt
        if app.input.is_key_down(keel.KEY_W): transform['y'] += player['speed'] * dt
        if app.input.is_key_down(keel.KEY_S): transform['y'] -= player['speed'] * dt

app.run()
The PyPI package name is keelpy. The import name is keel. Run pip install keelpy, then import keel in your code.

Build docs developers (and LLMs) love