Metadata-Version: 2.2
Name: box2d-python
Version: 0.1.2
Summary: Bindings for box2d v3
Author-email: Giorgos Giagas <giorgosg@gmail.com>
Maintainer-email: Giorgos Giagas <giorgosg@gmail.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-Box2D
Requires-Dist: cffi>=1.16.0
Provides-Extra: testbed
Requires-Dist: imgui_bundle; extra == "testbed"
Requires-Dist: PyOpenGL; extra == "testbed"
Requires-Dist: PyOpenGL-accelerate; extra == "testbed"
Requires-Dist: numpy; extra == "testbed"

# box2d-py
Python Bindings for Box2D v3 using CFFI

[![Documentation Status](https://readthedocs.org/projects/box2d-py/badge/)](https://box2d-py.readthedocs.io/)
[![Build Status](https://github.com/giorgosg/box2d-py/actions/workflows/build-matrix.yml/badge.svg)](https://github.com/giorgosg/box2d-py/actions/workflows/build-matrix.yml)

Python bindings for the [Box2D physics engine](https://box2d.org/) version 3. Provides Pythonic access to Box2D's feature set.

## Installation

Install from source using pip

```bash
pip install "git+https://github.com/giorgosg/box2d-py.git"
```

To include the testbed:

```bash
pip install "box2d-python[testbed] @ git+https://github.com/giorgosg/box2d-py.git"
```

Or Install from pypi:

```bash
pip install box2d-python[testbed]
```

## Running the Testbed

```bash
box2d-testbed
```

## Example Usage


```python
from box2d import World, Vec2
# Create physics world
world = World(gravity=(0, -9.81))
# Create static ground body
ground = world.new_body().static().position((0, -5)).box(1, 10).build()
# Create dynamic bodies
bodybuilder = world.new_body().dynamic().box(0.5, 0.5)
bodies = [bodybuilder.position((x, 5)).build() for x in range(-5, 5)]
# Simulation loop
for _ in range(60):
    world.step(1/60, 4)
```

## Development Status
⚠️ Early development preview - API subject to change  
Currently supports some of the Box2D v3.0 functionality with active development ongoing.

[Full API Documentation](https://box2d-py.readthedocs.io/) | [Box2D Project](https://github.com/erincatto/box2d)
