Skip to main content

Bindings for box2d v3

Project description

box2d-py

Python Bindings for Box2D v3 using CFFI

Documentation Status Build Status

Python bindings for the Box2D physics engine version 3. Provides Pythonic access to Box2D's feature set.

Installation

Install from source using pip

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

To include the testbed:

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

Or Install from pypi:

pip install box2d-python[testbed]

Running the Testbed

box2d-testbed

Example Usage

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 | Box2D Project

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.

box2d_python-0.1.2-cp313-cp313-win_amd64.whl (306.6 kB view details)

Uploaded CPython 3.13Windows x86-64

box2d_python-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

box2d_python-0.1.2-cp313-cp313-musllinux_1_2_i686.whl (1.6 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

box2d_python-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (539.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

box2d_python-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (495.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

box2d_python-0.1.2-cp313-cp313-macosx_11_0_arm64.whl (280.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

box2d_python-0.1.2-cp312-cp312-win_amd64.whl (306.6 kB view details)

Uploaded CPython 3.12Windows x86-64

box2d_python-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

box2d_python-0.1.2-cp312-cp312-musllinux_1_2_i686.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

box2d_python-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (540.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

box2d_python-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (495.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

box2d_python-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (280.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file box2d_python-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 95e2fb1ff657eaa4b97348ceb8830da977468a91171536ee229df460a6478bac
MD5 ae348a216112a996066254e22360d3a0
BLAKE2b-256 53975a8c6f570497aaa9444b70abbdb510ea7592da735e14d568f4cccbb30308

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f545d6b02ede15789f5285f40415b0571333f60cb8fbeeb24935b9f2aa2fecfd
MD5 110f18e40ae9575e3aa740153c84b448
BLAKE2b-256 158171b3a48004294269dd85a65676725625321107f798c6f49e585cb0291334

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 1cf021f75d8cca9cbd911cea07b32cb9fb1f0826d6d964c2efcf618bc238f700
MD5 c44a55ac08fdafd3522ac0c4a053178e
BLAKE2b-256 2ce9a8445f68d0d9e772f30dc6d74c0a88958a760e01b44033897e6696340494

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 653f7d250303db3b579f9d26f4e4ec232a24619632ec9b873d1a1209044519af
MD5 20b8934736111763a93e4e2e2a6b1eff
BLAKE2b-256 16627f7e31bbb05546e62a27e3897307f5f7cfb8a038159b4741aa08438cb705

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2964dfffc81aad12299b7b3b51a02f1e40129d5d97b320d8b69c264bd7c869cf
MD5 7ee577c0380a4ee08f5dfd34545b6501
BLAKE2b-256 49d8c2a12694c594764d2fc6dea37ad836ce72114514ec9e0e1fddcf1d5be320

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1a940f8fe654a25244be177b3c1763dc579f11009f012264d9bdd1e9dc0e4d3
MD5 fbe380a0e13fb1134d1ba32dd16d3848
BLAKE2b-256 b023d11b84c4e73a584bc78c45b6435fd3bb1271dfcee2c41c4ec5776ec97f5c

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8ca63aaeb357dc0a7fbf6a4b7835ecddb756b04ccd80ceb561e3608d410e29c2
MD5 0719a354db86a834736fe0c1f09331a9
BLAKE2b-256 c8522c56e10c82d59f27cd383fc5fdd9b9c7ba1ede8cacb44c332ed5bc889e25

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2dc6e2f350f621eb0ba003410914fa31295a70b0c46df377be4672cd797a83a1
MD5 49a6a616e81c124df620354bda1ead52
BLAKE2b-256 0dd5f87916b2e9def32d8586b07b753753c612e2030db3ba06a69a2ffd03ad1a

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 8dc8683fd57276d288efda01d1dfbd0291c67a7dccabc263012f1c29c2a7762d
MD5 4289ce3a482331cd45d6957141a79a87
BLAKE2b-256 97631b240bc1052aa45fff1af1e0f5ff3001f46c0534c7242d720010fdf11d17

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa80352fd8644438bf700099029347eea5d5af56cb13edb7263400b5183cfbbf
MD5 38b32cdb3e2f7c5b2cb77095002a7839
BLAKE2b-256 de56cd17bdd9f58fcac7a4b46be07f687b73eb1d7323ac0b71e32cac30d85314

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 cc143ba9926d50de7ba78575c05a9b149ce575d9d5ba108b73ca831284d3c042
MD5 96658580998c2cae8706e7c59af55f47
BLAKE2b-256 226c91a900c7b277318caf2406d25cd98ba28878368774d157cb659b2a437e0e

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75209e5eb03cb8844b62346a39e54b39f5ebafc5c050dc923c8c09b628a0c252
MD5 e16056a3eaff13b41322b9851a5fd77d
BLAKE2b-256 548eaec041f805c6108e1f4a26b60e7209ced622771e15ebe38cc40cf9935525

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