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

Uploaded CPython 3.14macOS 11.0+ ARM64

subtr_actor_py-0.3.0-cp312-cp312-win_amd64.whl (716.3 kB view details)

Uploaded CPython 3.12Windows x86-64

subtr_actor_py-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (918.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (921.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (922.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (923.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (951.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

subtr_actor_py-0.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (923.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: subtr_actor_py-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3cc797ad8d2db4a8b6bc3d8040fd92b024d5d5ffe940629ffbb060d76b64fc39
MD5 e04c9e5aa740241447201b61f400c009
BLAKE2b-256 8e18ab0d78b6ab2982efa7184ee22bf508db38f6f575c3827512be2aa9faf2c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ab4b10c701dce8d6ed784bea9f4168e2e62bffec301fb669edcb025ce460504
MD5 feea7dd81cb7646cc02f96acbf79ce1d
BLAKE2b-256 9389392a8a5a0f1947262d0f3fd6cd99b528e5348819f383b863ae4459a4581d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 91832a3a0a8061f4a83b17359df850f08ea1748d14b3789fc6b67703abcbd782
MD5 0f6aa40c9139e89d8c49e3f6598dfe86
BLAKE2b-256 af49c52178573a0d890c35703ff7edca9129ff04b651633645267d2173a1f8d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5d93d428b13b1a2545695d3b690c5ef42a4ea4f49e05339ca2b5764a4abe9ff4
MD5 d39447ca9bdf2ff61f356c0821cd0ed0
BLAKE2b-256 c7cbcdd538204e423bdf8cb461eb809b4df00a451fcafadc03c02b2f89be774e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 322e7cedfebb492c6014b8dccbab54e95a711f00cca8aa347afd1f627fa18c37
MD5 fa637cc6ace0931ee5f9969aa139975a
BLAKE2b-256 deca03b8594204db70f8932837622f808b3a1521a05a5a5ebbaa49993145db6e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 403f34cbc9d78ac3e90ee633d676a5172fed2c1c75ff71f63cb98481bc31c9b5
MD5 59e2f5cf336750eb405fa82b95a3a9af
BLAKE2b-256 c5ab2263dffb88892326f468d193547938b210ee08f0ca542364cd4dc81db4d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ac52a1b4f2e4b737f68fae42a379eab46336cc568f12d34bbc66e5d1dfdea330
MD5 ec15cae7db33b1aa7b2a796e8214a47e
BLAKE2b-256 a4dec9a1a6a642a5c1f19a98ec3ab92db4df5731a27fa0234a572933fe955272

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b4a294030ac02d06b37108b61fa7c41c52e2950db1d467640c5c841b639f99d
MD5 958254f8a8563fda839c8c94c18148ba
BLAKE2b-256 5ed4b8d4bd2f726a4ab05a1400bc2c8c0088589d28a1f785397daf47627f8983

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c295df43e98462a9545871aeac78dd87122f0cc42c8c2e536e2e01c30e311a2a
MD5 c898e09977f884c06fa0e4c40a23ca9d
BLAKE2b-256 3946c75f887491f33149497d9aa18def211a1ffdd4c0f95745025efda90eb746

See more details on using hashes here.

Provenance

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