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

# Parse a replay file to get raw replay data
replay = subtr_actor.parse_replay(open("path/to/replay.replay", "rb").read())

# Get numerical data as numpy ndarray (useful for ML)
meta, ndarray = subtr_actor.get_ndarray_with_info_from_replay_filepath(
    "path/to/replay.replay",
    global_feature_adders=["BallRigidBody"],  # optional
    player_feature_adders=["PlayerRigidBody", "PlayerBoost", "PlayerAnyJump"],  # optional
    fps=10.0,  # optional, default is 10.0
    dtype="float16"  # optional: float16|float32|float64 (default float32)
)

# Get column headers to understand the ndarray structure
headers = subtr_actor.get_column_headers(
    global_feature_adders=["BallRigidBody"],
    player_feature_adders=["PlayerRigidBody", "PlayerBoost"]
)

# Get replay metadata without processing all frames (faster)
meta = subtr_actor.get_replay_meta("path/to/replay.replay")

# Get structured frame-by-frame data
frames_data = subtr_actor.get_replay_frames_data("path/to/replay.replay")

API Reference

parse_replay(data: bytes) -> dict

Parse raw replay bytes and return the complete replay structure.

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 of features.

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 - Frames per second for processing (default: 10.0)
  • dtype - Output ndarray dtype string: float16/f16, float32/f32, float64/f64 (default: float32)

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

Get replay metadata without processing frame data (faster than full processing).

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

Get column header information for understanding ndarray structure.

get_replay_frames_data(filepath) -> dict

Get structured frame-by-frame game state data.

Feature Adders

See the subtr-actor documentation for available feature adder names.

Common global features: BallRigidBody, GameTime

Common player features: PlayerRigidBody, PlayerBoost, PlayerAnyJump, PlayerDoubleJump

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

Building from Source

Requirements:

  • Rust toolchain
  • maturin
  • just (command runner)
# Clone the repository
git clone https://github.com/rlrml/subtr-actor.git
cd subtr-actor

# Build the Python package
just build-python

# Or for development (editable install)
cd python && maturin develop

Monorepo Dependency Management

This package is part of the subtr-actor monorepo. The Cargo.toml uses a dual dependency specification:

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

This allows:

  • Local development: Cargo uses the path dependency, so changes to the main subtr-actor crate are immediately available for testing
  • Publishing: crates.io/PyPI strips the path and uses the version, ensuring the published package depends on the published crate

Use just bump <version> to update all versions in sync (workspace version and dependency versions).

Publishing

To publish all packages in the correct order:

just publish-all  # Publishes: Rust crate -> Python bindings -> JS bindings

Or publish individually:

just publish-rust    # Publish main Rust crate first
just publish-python  # Then publish Python bindings

Important: The main subtr-actor Rust crate must be published to crates.io before publishing the bindings, as the published bindings depend on the published crate version.

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.1.16.tar.gz (9.7 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.1.16-cp314-cp314-macosx_11_0_arm64.whl (737.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

subtr_actor_py-0.1.16-cp312-cp312-win_amd64.whl (610.9 kB view details)

Uploaded CPython 3.12Windows x86-64

subtr_actor_py-0.1.16-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (805.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.1.16-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (809.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.1.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (809.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.1.16-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (812.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

subtr_actor_py-0.1.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (822.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

subtr_actor_py-0.1.16-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (812.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: subtr_actor_py-0.1.16.tar.gz
  • Upload date:
  • Size: 9.7 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.1.16.tar.gz
Algorithm Hash digest
SHA256 a215fb5f19868aab9fa0e8575cc84185b3419e9a9111db05a1f11e68ba970e4f
MD5 f7624759a0eef2b75fea870a2a478ed3
BLAKE2b-256 bf978550e6835abafb62360548b4bb3496cd1695da3eeb042c73e960de1eaeca

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c4df26b3652b1efb98a56669cdcb6684510ba0d399885c531deaf2d76a88c9a
MD5 25cee4d0b7b9e8ea0a7d1c3370e73719
BLAKE2b-256 c4bffedeec30284cb263ba6b9f1eb84f946bee19ac02a666c85029d3e2a5a812

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 594c1c6513180c24318674fe9b425f99db2e7f988ada76a8964bf0c5d4dbef57
MD5 60d92e62b236bc96b9b8f4be45566b1b
BLAKE2b-256 531c1df25cb8da1f21f8acd3cc06564a8850016246fb0fbc164f717ad96ab262

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f3afbcf6b45e31c72e8e5500833988af633ffe87591062fbb3fe34609dd39adf
MD5 244e6ec831be601239dd937ed19a7c2e
BLAKE2b-256 08cd96355962cda973e4e0d54ff33ca39c11bd3db36415ceff6cced47fa1b1d2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e53d735f80b7902ba6a3d065f108637e72939191f16daf9af852eff2ec39d04
MD5 1a2ccd9ffde98153ae30e8244ef5a756
BLAKE2b-256 e28a415fef38e360b75bb63890790ce712b4865076e08dc831cf8a6bc5e0852e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 62ffd96cb1c547d065bbca0afb40fe326888661bc922d0b5971614adbf9267e4
MD5 b4a806d2f222a49120a9377b1765fa3a
BLAKE2b-256 5687af747243d3ae968f4f15ca1bd3453f67e11d9b923995cecb28ad840a13e6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bdf71fdd96a26fd2c7ab93ac8ecd0e43f2c69783b78cc4250c6767b5de6221ae
MD5 3cb9c7bb614c9556308d5979190d4c41
BLAKE2b-256 3ac9b2f2bd85e6deb662f2a4c5ad0708d3005a642dd30a19009fec595141301c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31189309a4f240c248d48664c8cf3a9f33f66b372685d6d555e67758ecdb09bf
MD5 b87c3df7f49dfddcb0a61db55cb16805
BLAKE2b-256 9c92f3f61be7a665311096ec2eecdffab108716fd893e3302cd3a310965136ec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for subtr_actor_py-0.1.16-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a30de19f3582c0a0379961fb87e782035a5119a9292b65a03c0a1cde90420c5b
MD5 5899a6d0eb603dae477663c60b84ecdf
BLAKE2b-256 8edb0ad6d25e6a54fa2ac6b8c3faf5b899e5c74190efe5db0b8cec34d46f7034

See more details on using hashes here.

Provenance

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