Skip to main content

PyGuara Engine

PyGuara is a production-grade, 2D game engine for Python 3.12+. It combines the clean architecture of enterprise software with the fun of game development, featuring a high-performance Entity-Component-System (ECS), a native Dependency Injection (DI) container, and a suite of professional tools.

Status: Alpha (Feature Complete Core). APIs are stable but subject to refinement.

CI codecov Python versions Ruff License

🌟 Why PyGuara?

Most Python game libraries (like Pygame) give you a window and a loop, leaving you to build the "engine" yourself. PyGuara provides that structure out of the box.

  • Structure, not Spaghetti: Built on Dependency Injection and ECS, your code remains decoupled and testable, even as your project grows.
  • Batteries Included: Physics, UI, Pathfinding, Behavior Trees, Tweening, and Tilemaps are all built-in.
  • Developer Experience: Includes a live in-game editor, hot-reloadable config, and robust logging.

🚀 Key Features

  • ⚡ Performance-First ECS:
    • Optimized EntityManager using Inverted Indexes for $O(1)$ queries.
    • Memory-efficient component storage.
  • 🛠️ Professional Tooling:
    • Live Editor: Press F12 to open the hierarchy inspector, modify components in real-time, and save scenes.
    • Debug Tools: Visual gizmos, performance profilers, and event monitors.
  • 🎨 Advanced Rendering:
    • Backend-agnostic pipeline (currently pygame-ce) with automatic Batching and Z-sorting.
    • Camera system with zoom, shake, and multiple viewports.
  • ⚛️ Physics & AI:
    • Native Pymunk integration for rigid bodies, joints, and raycasting.
    • Behavior Trees, Finite State Machines (FSM), and A Pathfinding*.
  • 🖥️ UI System:
    • Constraint-based layout engine (Flexbox-like).
    • Declarative widget composition with theming support.
  • 🎬 Animation & Scripting:
    • Powerful Tweening engine for smooth value transitions.
    • Coroutine system for writing sequential, timed game logic.

📚 Documentation

🛠️ Installation

PyGuara requires Python 3.12 or higher.

pip install pyguara

The wheel carries the engine's native accelerator, so pathfinding, flocking, particles and the spatial index run compiled without a Rust toolchain anywhere in sight. Working on the engine itself is the case that needs one: maturin is the build backend, so a checkout compiles the crate and wants stable Rust (rustup) installed. See ADR 0006.

# Clone the repository
git clone https://github.com/Wedeueis/pyguara
cd pyguara

# Sync dependencies and install
uv sync

Using make

# Clone and enter the repository
git clone https://github.com/Wedeueis/pyguara
cd pyguara

# One command to sync everything (core, dev, docs, benchmarks)
make install

Using pip

pip install -e .[dev]

🎮 Quick Start

To run the engine sandbox and see the features in action:

python main.py

Code Example: A Simple Scene

from pyguara.scene.base import Scene
from pyguara.common.components import Transform
from pyguara.graphics.components import Sprite
from pyguara.physics.components import RigidBody, Collider
from pyguara.common.types import Vector2
from pyguara.graphics.components import Texture

class GameScene(Scene):
    def on_enter(self) -> None:
        # 1. Load Assets
        texture = self.resource_manager.load("player.png", Texture)

        # 2. Create Entity
        player = self.entity_manager.create_entity("Hero")

        # 3. Add Components (Data)
        player.add_component(Transform(position=Vector2(100, 100)))
        player.add_component(Sprite(texture=texture))

        # 4. Add Physics
        player.add_component(RigidBody(body_type=BodyType.DYNAMIC))
        player.add_component(Collider(shape_type=ShapeType.BOX, dimensions=[32, 32]))

🤝 Contributing

Contributions are welcome! Please ensure you adhere to the project's code quality standards.

  1. Run tests: pytest
  2. Lint: ruff check .
  3. Type Check: mypy pyguara

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

✍️ Author

Developed by Wedeueis Braz.

Metadata

Release files for pyguara 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyguara 0.6.0
File Size Uploaded Provenance Actions
pyguara-0.6.0.tar.gz 888.1 kB Without provenance Details for pyguara-0.6.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyguara 0.6.0
File Actions
pyguara-0.6.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for pyguara-0.6.0-cp312-abi3-win_amd64.whl
pyguara-0.6.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for pyguara-0.6.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pyguara-0.6.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for pyguara-0.6.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pyguara-0.6.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for pyguara-0.6.0-cp312-abi3-macosx_11_0_arm64.whl
pyguara-0.6.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for pyguara-0.6.0-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 9.8 MB

Release files / pyguara-0.6.0.tar.gz

Download URL pyguara-0.6.0.tar.gz
Size 888.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2ae9bfdd486299bb0cadcfc6b508a07eb71afa7b1c37749382858cc9aaadd5a8
BLAKE2b-256 checksum
How to use checksums
07040fadc78d6d9009eea300a16e675e9478978ebebbdb93efaadebae413e3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyguara-0.6.0-cp312-abi3-win_amd64.whl

Download URL pyguara-0.6.0-cp312-abi3-win_amd64.whl
Size 1.7 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0c80adac61a75f25bd8c2cf9ee47889ae66f38349211d8f8e8ac82aba41cf349
BLAKE2b-256 checksum
How to use checksums
76790154a6527055f776ac4f3994ff0422f5c4f72eff230a18abc5d378ce9df6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyguara-0.6.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pyguara-0.6.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
1509bfddda02e483c4acec1f0bbe3c7dcb72ad2cf5add87429353e3e533b05c8
BLAKE2b-256 checksum
How to use checksums
ac72215f5a08c627f1468d8949666425bae59226e7e5d2484301f3420001915c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyguara-0.6.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pyguara-0.6.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.8 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b6605e8f3c58235e7059e9e08091f0df294c2aa5c4dc45fe448ea4d022066405
BLAKE2b-256 checksum
How to use checksums
ee6c3d7c1127c60681a8349b1f8d8a196d33ba023a27f11bb6f45abf6c63d7a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyguara-0.6.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL pyguara-0.6.0-cp312-abi3-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b7e6c7974817019e6a70064af718b79410d6fa34859607ee548bd4f5a440c473
BLAKE2b-256 checksum
How to use checksums
77f167c3256fd2d22d04d1ea9b53f0d6e9ff8fe9b96e441b86614a621b25555e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pyguara-0.6.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL pyguara-0.6.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.8 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
eea152caa894e466b8c764e2335784e55fb3363d537c3e1b797217e4d69d68cb
BLAKE2b-256 checksum
How to use checksums
7c61cb8bd957747a803ee1f3d30a732b5a7b33a5170d5b7e530ca8ebf4ea3f2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for pyguara 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page