Skip to main content

Python bindings for the Rocket League replay processing library subtr-actor.

Project description

subtr-actor-py

Python bindings for subtr-actor, a Rocket League replay processing library.

Installation

pip install subtr-actor-py

Usage

import subtr_actor

replay_path = "path/to/replay.replay"

# Parse raw replay bytes into the full replay structure.
with open(replay_path, "rb") as replay_file:
    replay = subtr_actor.parse_replay(replay_file.read())

# Build a numpy ndarray plus metadata.
meta, ndarray = subtr_actor.get_ndarray_with_info_from_replay_filepath(
    replay_path,
    global_feature_adders=["BallRigidBody", "SecondsRemaining"],
    player_feature_adders=["PlayerRigidBody", "PlayerBoost", "PlayerAnyJump"],
    fps=10.0,
    dtype="float32",
)

headers = subtr_actor.get_column_headers(
    global_feature_adders=["BallRigidBody", "SecondsRemaining"],
    player_feature_adders=["PlayerRigidBody", "PlayerBoost"],
)

replay_meta = subtr_actor.get_replay_meta(replay_path)
frames_data = subtr_actor.get_replay_frames_data(replay_path)

print(ndarray.shape)
print(headers["player_headers"][:5])
print(replay_meta["map_name"])

API Surface

parse_replay(data: bytes) -> dict

Parse raw replay bytes and return the full replay structure as Python data.

get_ndarray_with_info_from_replay_filepath(filepath, global_feature_adders=None, player_feature_adders=None, fps=None, dtype=None) -> tuple[dict, numpy.ndarray]

Process a replay file and return metadata plus a numpy.ndarray.

Parameters:

  • filepath: path to the replay file
  • global_feature_adders: list of global feature names, default ["BallRigidBody"]
  • player_feature_adders: list of player feature names, default ["PlayerRigidBody", "PlayerBoost", "PlayerAnyJump"]
  • fps: target FPS for resampling, default 10.0
  • dtype: output dtype string. Supported values are float16/f16/half, float32/f32, and float64/f64/double

get_replay_meta(filepath, global_feature_adders=None, player_feature_adders=None) -> dict

Get replay metadata and ndarray headers without materializing the full ndarray.

get_column_headers(global_feature_adders=None, player_feature_adders=None) -> dict

Get header information for the configured ndarray layout.

get_replay_frames_data(filepath) -> dict

Get structured frame-by-frame game state data with no FPS resampling.

Feature Adders

See the subtr-actor ndarray docs for the full list of feature-adder names.

Common global features:

  • BallRigidBody
  • CurrentTime
  • SecondsRemaining

Common player features:

  • PlayerRigidBody
  • PlayerBallDistance
  • PlayerBoost
  • PlayerAnyJump
  • PlayerJump
  • PlayerDodgeRefreshed

PlayerBoost is exposed in raw replay units (0-255), not 0-100 percent.

Development

Repository-level compile check:

just build-python

For an importable local Python environment, use maturin develop from the python/ directory:

cd python
uv sync --group dev
uv run maturin develop
uv run pytest

If you are using the repo flake, nix develop now provides the pinned CPython 3.11 toolchain and Python dev dependencies via uv2nix. Create a writable virtual environment from that interpreter, then install the local extension into it:

nix develop
uv venv /tmp/subtr-actor-venv
source /tmp/subtr-actor-venv/bin/activate
cd python
maturin develop
pytest

If you are not using uv or Nix, install maturin, pytest, and numpy in a virtual environment and run maturin develop directly.

Publishing Notes

This binding depends on the workspace crate via:

[dependencies.subtr-actor]
path = ".."
version = "0.2.3"

That keeps local development wired to the workspace crate while still pinning the published dependency version. Use just bump <version> to update the workspace and binding versions together.

License

MIT

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

subtr_actor_py-0.2.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

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

subtr_actor_py-0.2.3-cp314-cp314-macosx_11_0_arm64.whl (844.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

subtr_actor_py-0.2.3-cp312-cp312-win_amd64.whl (715.7 kB view details)

Uploaded CPython 3.12Windows x86-64

subtr_actor_py-0.2.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (919.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.2.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (921.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (922.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (922.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (950.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (923.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

File details

Details for the file subtr_actor_py-0.2.3.tar.gz.

File metadata

  • Download URL: subtr_actor_py-0.2.3.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for subtr_actor_py-0.2.3.tar.gz
Algorithm Hash digest
SHA256 bf2296cde999e52a78ba04d1c136ec77167b456ea08d17d58ea9e3bd4452ae24
MD5 edefaf26ed1044edfc742e84cfcb37c1
BLAKE2b-256 978bca0c1ecd9882ca64874875d1137a8c0636941eeb44f97c6a574069145e56

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3.tar.gz:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8d4a4bde7b9d9b80bbaff879fa3eb3cb344f5afbad63f92b588fd070e2da467
MD5 ccdce0d4cdc96296d88675ebdfdc25b4
BLAKE2b-256 ae00d0b5b64205a80003a0f95ae14fec6d00ce1c9c2090c9ae52a11860f5a436

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5570c05828b27f0ef25bfa5be5f7e4268da4d8f5fc7ef1a4ef2395ed7278d027
MD5 52c321aac1edef7358f8f398f8b8a124
BLAKE2b-256 83faf8f8f0e16452854ca3a5ea1c17411b1a5d27228ed567a6a0a94fffbe33ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp312-cp312-win_amd64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fea2bb2a3ce262a044af29ebdb66c70c374d437b0bcb3dae63f6d320465faea4
MD5 2c3a8f369aff265a5ec3783aa51690c7
BLAKE2b-256 65083ee5b161749c37b646a724444606de60c90f9fa0544dab73ab58f5a270e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9addda044342ec4586c1d468098187f46c41e2a4ff2e695d7c50bbe59bcdce57
MD5 18d01e0c4254013a4821b095342f0607
BLAKE2b-256 0c10b5f12990077a34c6febbe2070c852174551e8149a2cc197a20c156bc07f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e8f1baed532812119511bf8b8c195668f968fd0bafa4d05f73994b55616a84e6
MD5 61d3e6b3465ea17a3d556c16a41dd78f
BLAKE2b-256 3acf4421b67504c0a483d69b74a17016e016b35950159363dc4c0f194311641b

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bfe8c3302f83005716065da6f6f4a121dad7361482db31506788e7284df6a422
MD5 1931eb50ceb14ec61234bee2773ee3da
BLAKE2b-256 d6ca566ff5db8a9a0c3f2b2b11317a28dbe9304b06977da6d6e84efc70d9dd7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 92f84ae0c880c1c909505507912f7e3c95e54f3d1303fefd9f7ae627a80444b5
MD5 66b4f9994a83a0f0dd03ef8db8a6c15a
BLAKE2b-256 3ff4b1b69ebd0996d6d8bc0b571e1ed25c27678225b1e234f8fb11e5aeedc712

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4f7e2bf8ff3f0a470fc1f76aa916988a53e6d0485f5d00c03d72216b5ccc2602
MD5 9da81d7a0261c2d74026c96ca75aeeb6
BLAKE2b-256 8db7569c19deba35c1df53720a3d090a6c03a395db634a0fa6789ff5464b4c9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.2.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on rlrml/subtr-actor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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