Skip to main content

High-Performance 2D/3D Development in Python, Powered by the Bevy Engine

Project description

pybevy: Python 2D/3D Powered by the Bevy Engine

Discord License pypi pypi downloads

pybevy.com — Project website & documentation

Warning: Beta State

Pybevy is in an early and experimental stage. The API is incomplete, subject to breaking changes without notice, and you should expect bugs. Many features are still under development.

What is pybevy?

Pybevy is a Python extension that bridges the productivity of Python with the performance of the Bevy Engine, a refreshingly simple data-driven game engine built in Rust.

Hot-reload is the star feature - modify your Python code and see changes instantly in your running application, making development incredibly fast and iterative. Combine the vast Python ecosystem with Bevy's cutting-edge 3D engine: leverage NumPy, SciPy, Matplotlib, PyTorch, and thousands of other packages while enjoying high-performance 3D rendering and physics. Write clean, Pythonic code to build games, simulations, and interactive applications without sacrificing speed. pybevy empowers you to leverage Bevy's massively parallel, cache-friendly ECS (Entity Component System) architecture directly from Python.

Hot reloading demo

pybevy is an independent, community-driven project built with great respect for the Bevy Engine and its developers. It is not officially affiliated with the Bevy project.

Why pybevy?

pybevy is designed for developers who love Python but need more performance for graphically-intensive applications.

  • Lightning-Fast Development with Hot-Reload: See your code changes instantly without restarting your application. Modify game logic, adjust parameters, or tweak visuals and watch them update in real-time, dramatically accelerating your development workflow.
  • Python Ecosystem Meets Cutting-Edge 3D: Access the entire Python ecosystem—NumPy, Pandas, SciPy, PyTorch, OpenCV, and more—while rendering with Bevy's state-of-the-art 3D engine. Build data-driven applications, AI-powered games, or scientific visualizations with the best of both worlds.
  • Performance Without Compromise: Eliminate the "performance wall" common in Python 3D development. Performance-critical engine internals—like rendering and scheduling—run at near-native speed in Rust, while your game logic lives in expressive Python.
  • Rapid, Scalable Prototyping: Start your project entirely in Python to iterate quickly. As your needs grow, seamlessly rewrite performance-critical systems in Rust for a powerful hybrid approach. Your prototype can become your final product without switching engines.
  • High-Performance Visualization: The perfect backend for visualizing massive datasets (e.g., point clouds, simulations) in real-time by leveraging Bevy's rendering power with data loaded via libraries like NumPy and Open3D.
  • Modern ECS Architecture, Made Accessible: Learn and use Bevy's powerful, data-oriented Entity Component System paradigm with simple Python functions and classes. It's an ideal tool for teaching modern engine design without the steep learning curve of Rust.

Getting Started

Installation

Requires Python 3.12+. Pre-compiled wheels are available for the following platforms:

Platform Architecture
Linux x86_64
macOS ARM (Apple Silicon), x86_64
Windows x86_64
pip install pybevy --upgrade

Quick Look: The pybevy Syntax

The API is designed to feel natural and intuitive, closely mirroring Bevy's own "refreshingly simple" philosophy.

Pure Python Approach

A simple 3D scene, written entirely in Python. Perfect for getting started and rapid iteration.

# A simple 3D scene with a cube sitting on a plane.
from pybevy.prelude import *
import math

# Bevy systems are just Python functions with type-hinted parameters.
def setup(
    commands: Commands,
    meshes: ResMut[Assets[Mesh]],
    materials: ResMut[Assets[StandardMaterial]],
) -> None:
    # Circular base
    commands.spawn(
        Mesh3d(meshes.add(Circle(radius=4.0).mesh())),
        MeshMaterial3d(materials.add(StandardMaterial.from_color(Color.WHITE))),
        Transform.from_rotation(Quat.from_rotation_x(-math.pi / 2)),
    )

    # Cube
    commands.spawn(
        Mesh3d(meshes.add(Cuboid(1.0, 1.0, 1.0).mesh())),
        MeshMaterial3d(materials.add(StandardMaterial.from_color(Color.srgb_u8(124, 144, 255)))),
        Transform.from_xyz(0.0, 0.5, 0.0),
    )

    # Light
    commands.spawn(
        PointLight(shadows_enabled=True),
        Transform.from_xyz(4.0, 8.0, 4.0),
    )

    # Camera
    commands.spawn(
        Camera3d(),
        Transform.from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3.ZERO, Vec3.Y),
    )

@entrypoint
def main(app: App) -> App:
    return app.add_plugins(DefaultPlugins).add_systems(Startup, setup)

if __name__ == "__main__":
    main().run()

Save this as main.py and run it with the pybevy watch command, which starts your app in hot-reloading mode:

pybevy watch --full main.py

Now you can edit main.py while the application is running, and see your changes reflected instantly!

The --full flag reloads everything on each change, including setup systems (scene creation, spawning entities). Without it, only game logic (Update systems) is reloaded — faster for iterating on runtime behavior once your scene is set up.

Bevy Compatibility

pybevy versions target specific Bevy versions:

pybevy Bevy
0.1.x 0.18

Documentation

  • pybevy.com — Project website
  • Examples — Runnable examples covering 2D, 3D, ECS, animation, physics, and more

Community & Contributing

  • Join the Conversation: The best place to ask questions and chat is the official Pybevy Discord.
  • Contributing: See CONTRIBUTING.md for how to get involved.

License

All code in this repository is dual-licensed under either:

at your option.

By contributing, you agree your work will be released under both licenses.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pybevy-0.1.0-cp314-cp314-win_amd64.whl (31.8 MB view details)

Uploaded CPython 3.14Windows x86-64

pybevy-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl (33.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

pybevy-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (28.7 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pybevy-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl (30.5 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

pybevy-0.1.0-cp313-cp313-win_amd64.whl (31.6 MB view details)

Uploaded CPython 3.13Windows x86-64

pybevy-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (32.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

pybevy-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (28.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pybevy-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl (30.4 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

pybevy-0.1.0-cp312-cp312-win_amd64.whl (31.6 MB view details)

Uploaded CPython 3.12Windows x86-64

pybevy-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (32.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

pybevy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (28.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pybevy-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl (30.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

File details

Details for the file pybevy-0.1.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pybevy-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 31.8 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pybevy-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c455b5411bb6f52271525366d2eb2867a56b03d8eacde34427b4620e61d41e53
MD5 94c7ff1e283c5e04bb11c4b19e023c37
BLAKE2b-256 f96e9a2b20da91a9463ef237d1a8914f01463b94c98cf60a8b3d5060c4af6fcb

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ab4d65b705ac34d20668823eaf581ef50ee26bef42b1283b626c05190e080937
MD5 f6bddb81449593a410e6ccd6e313c456
BLAKE2b-256 d7ed470356c255762d238ed2df3862cee2ca451d58d9ba31b113834495a4181d

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44d047284389f07ba5f265fe845b18e38bfd17809710acdc047ec919e33141c1
MD5 8aadb05fe22bc0c5e90788a3266372b2
BLAKE2b-256 d1bb7e7bc8668f95e05ceeb431c77d5155c0e886a427974f4d08b28b71a541fa

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1a7e5d1343a2f1f952e7b871d38dc01bf048db6125d63be848b6104aa732c6e8
MD5 bdc9b586cebcc8ccf9277ed056cd4791
BLAKE2b-256 a8db85c4286eff89d738c8ee7e425cbf1259167fa019d819bf0a6a550d0fb9a4

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pybevy-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 31.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pybevy-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 80724ae6ebd39fe0fecb8248456aecd9acd2233a67726352f004db1396eb49b9
MD5 8ffa6a8251a2c0cef7ed68536a317eb9
BLAKE2b-256 0e184f3b452044f13c821e34b517f9556eed5cddb889fbaaaa5e190d93fa0de2

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e27c5af4b2af0ef22337791443d47dca4c07e974a355ade6a3510edcc0bdc582
MD5 c69de320b92e4ecaf338d570d8996ed5
BLAKE2b-256 2e5654838773fb9e7c5c8163cef78f92f80f7c7f16f61c0bafc78fdfe8bf4bf1

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7b419375910421491fedb104a32a9926867f51298f3584f582d3476e82ca4ba4
MD5 5a7be1e7081e38580b6bbeb6b7ca5a22
BLAKE2b-256 451caa35cf8b3122d2ede39699b6ce541b956102fd5f657754ba84fd20e51296

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3160c400543cd6173d069dd5d4fdd95c975f78555ac97e69078960738ad2ce40
MD5 f027fcf44431c0a26874faae6bef3b68
BLAKE2b-256 d0cec46421df736b9574260c03ad92a0317e39263b9fa7340675075dfeb83c60

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pybevy-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 31.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pybevy-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dcfc63b30e5fe195744b39b9056af01a0e2f5a2c3bec520eacb001679cd0fb6b
MD5 5df6f6339475579c0723eada590e5349
BLAKE2b-256 7d0b5f76c9db315da345e1f31ab5b1eb613e29f1ff059053459813d4698aaaf0

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9dd84e03a9cd4c176be2ea6f7c511a84d14cc2a624dab0a48bea68d3e9d2bd9d
MD5 83315b84a6a142b9169afc1505150e85
BLAKE2b-256 ac7d2a475e1f336b326dcd44078244957c0c1f476176560975a7c794ec2fadc1

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7579650db15a2a94741f66b2db6e5bb805bb952261d83b2248d656ca7bdb840
MD5 3166b54dea184122c6a3dcc917637f03
BLAKE2b-256 5deb4ff4304a709b495d0d53396550a7ce9ee2939ca9b61b7411c89d7285f637

See more details on using hashes here.

File details

Details for the file pybevy-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pybevy-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 72d0f3c82b4ca45b4fd3b2e4ad99e2bdf8dc4609dc7cee8dfd25e3ca49d17934
MD5 1daba60140fa33c5674c1f5164d47a01
BLAKE2b-256 7c4d1a7c044c7bb51a1942851a8c7e30fad7fffc75e3cab875590aeb3e71aba3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page