Skip to main content

A fast and ergonomic ECS library for Python, written in Rust.

Project description

Documentation:

https://xecs.readthedocs.io

xecs is a Python library (written in Rust!) for a performant entity component system (ECS). You can use it to write simulations, games or any other high-performance piece of software.

If you are familiar with Bevy and NumPy – the API of xecs should be familiar to you.

The goals of xecs are as follows:

  • Fast: Operations are executed in parallel as much as possible and the library is written in Rust to be cache friendly and performant.

  • Simple: Data is defined with a dataclass-like syntax and systems are regular Python functions.

  • Typed: Types form an integral part of the API, making code clean but also easily verified with type checkers.

  • NumPy-friendly: Our data types can be used seamlessly with NumPy.

  • Python-friendly: User code is regular Python code, allowing full integration with the Python ecosystem. We avoid things like Numba which cause pain during debugging and limit use of pure Python libraries.

Code Preview

import xecs as xx

class Velocity(xx.Component):
    value: xx.Vec2

def update_positions(query: xx.Query[tuple[xx.Transform2, Velocity]]) -> None:
    (transform, velocity) = query.result()
    transform.translation += velocity.value

Installation

pip install xecs

Project details


Download files

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

Source Distribution

xecs-0.9.0.tar.gz (58.4 kB view hashes)

Uploaded Source

Built Distributions

xecs-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

xecs-0.9.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ s390x

xecs-0.9.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ppc64le

xecs-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

xecs-0.9.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.5+ i686

xecs-0.9.0-cp311-none-win_amd64.whl (336.7 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

xecs-0.9.0-cp311-none-win32.whl (311.8 kB view hashes)

Uploaded CPython 3.11 Windows x86

xecs-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

xecs-0.9.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ s390x

xecs-0.9.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

xecs-0.9.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

xecs-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

xecs-0.9.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.5+ i686

xecs-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (478.8 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

xecs-0.9.0-cp311-cp311-macosx_10_7_x86_64.whl (494.5 kB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

Supported by

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