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.3.1.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.3.1-cp314-cp314-macosx_11_0_arm64.whl (846.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

subtr_actor_py-0.3.1-cp312-cp312-win_amd64.whl (717.3 kB view details)

Uploaded CPython 3.12Windows x86-64

subtr_actor_py-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (920.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (922.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (923.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (924.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (952.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

subtr_actor_py-0.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (924.5 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: subtr_actor_py-0.3.1.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.3.1.tar.gz
Algorithm Hash digest
SHA256 7ee33b1220f1f63dd6e259885924d172ef96a4f0cc4ab4bd1e9e9844edd35e72
MD5 5f80ff9cbec18ccd366a9b803f364622
BLAKE2b-256 8e2ff8d69848d7c637258ffc8d2333371b1450e2417921360ab7a7585b272d56

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1.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.3.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c80d2a62c25bbd62f116b420bada05cf1b3300fa942e4af48ed3801f6afc924
MD5 e420dbf9e8cf1eb2f3175526debab62d
BLAKE2b-256 acbede25542d7ed81b9ebb7d21e37728a6cd0b9b3b43d63d2e27fd43a94d57fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6b913c7a11b8ecd3444b995859ba2424e27d29bf8b00f078daddb673a7ed3008
MD5 6c9fb2b5a8ea00b00424365dba531de1
BLAKE2b-256 73d5bd04509bddc6061d7ca6803339a36f9c3b8a139590a7ba5e645c99a4316c

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 259a2df3a43862d4ba4e4d73e5b32870dd535d45da08a7b4656ad706877ca486
MD5 134d1e52b0846e00e0e81650226e1388
BLAKE2b-256 90e78ac894db649fc38d9de5084b9788e4f5b6297ee1d912233ca59d19b55d7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d778c1902ad39a02fe38dd1d6a13daab4eb4c1fc4e4d55b52c3d7be5c3e6c8d
MD5 d00a8fd385f43e7e67081592e11fbdac
BLAKE2b-256 429ee19931d5183fbdd3322092fef2d2223bdef6a9c7c3e9c0271d1aa8aa5fd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3e6e475f4c5380df349edec4de27826bbfce397597f6f92ebdad36fe2f6556bd
MD5 4b565ed45a7ad5fe857bd11d359c4038
BLAKE2b-256 3cffefc84f98d1db5018495cca4c49b99ffa5f86803511b4e6322bec77eb006a

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 06946a41b963a4f0853a65095c80f53a3bbd01931013c9bb2516ce1f2e069577
MD5 62b37b7b94870ead2ae16ff94ad5fc43
BLAKE2b-256 df070ca6b98a63badbb2792cef3a05cec44b499f7b365b86a1389b86332d5ce1

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 83ed44fa88e29105a090d24a9dc761e4197c76429c5d60e68e84a7b706b9155d
MD5 6696eb0eef0030e9a9ce61b40c43c756
BLAKE2b-256 c48e92819b5472f9b342406da7b5ea51a2f55cdb089527da8f6027348b43e0be

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for subtr_actor_py-0.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e214480ceeb83915f9f3be032c92a0b2c7a3b8132516c6533f3ceb7a2fc136d8
MD5 5034d12f01055c670407b063f0e1aa95
BLAKE2b-256 c72f458ec18eb630145ad61f5060d3f0086a99799c97936b0f33a4c0a29f1391

See more details on using hashes here.

Provenance

The following attestation bundles were made for subtr_actor_py-0.3.1-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