rustforge (Python bindings)
PyO3 bindings to the RustForge RL framework: native environments and a DQN agent, plus a Gymnasium-compatible adapter.
Install
pip install rustforge-rl # native environments + DQN
pip install "rustforge-rl[gym]" # plus the Gymnasium bridge
The distribution is named rustforge-rl; the import name is rustforge.
Wheels are abi3 (one per platform, CPython ≥ 3.9) for Linux x86_64/aarch64,
macOS universal2, and Windows x86_64.
Install (development)
cd crates/rustforge-python
python -m venv .venv
# Windows: .venv\Scripts\Activate.ps1 | Unix: source .venv/bin/activate
pip install "maturin>=1.9,<2.0" pytest "gymnasium>=0.29" "numpy>=1.21"
maturin develop
Usage
import rustforge
# Gymnasium-style env
env = rustforge.make("CartPole")
obs, info = env.reset(seed=0)
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
# Train + run a DQN
agent = rustforge.DQN.train("cartpole", episodes=200)
action = agent.predict([float(x) for x in obs])
Available env ids: CartPole, GridWorld, MountainCar, MountainCarContinuous, Pendulum.
DQN.train supports the discrete envs: "cartpole", "gridworld", "mountaincar".
Error handling
Discrete environments (CartPole, GridWorld, MountainCar) validate the
action passed to step:
- An out-of-range action (e.g.
5when only0,1are valid) raisesValueError. - A negative action (e.g.
-1) raisesOverflowError, notValueError. The action is a Rustusize, so PyO3 rejects negative integers during argument conversion, before the range check runs.
Continuous environments (Pendulum, MountainCarContinuous) raise
ValueError when the action list has the wrong length (they expect length 1).
Release files for rustforge-rl 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rustforge_rl-0.1.0.tar.gz | 253.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| rustforge_rl-0.1.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| rustforge_rl-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| rustforge_rl-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| rustforge_rl-0.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.9 | abi3 | macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 | Details |
Total release size: 2.8 MB
Release files / rustforge_rl-0.1.0.tar.gz
| Download URL | rustforge_rl-0.1.0.tar.gz |
|---|---|
| Size | 253.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13bfad96f89ae31423dcd2d44ceb8d65fcdb46232f9b94a04ca16ee96612e2f0
|
|
BLAKE2b-256 checksum How to use checksums |
b0b9ad8a7a55a1138f9b0534b77f6230871aaedd3b6f36c60e4d8a1c8f36cef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency logRelease files / rustforge_rl-0.1.0-cp39-abi3-win_amd64.whl
| Download URL | rustforge_rl-0.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 400.0 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
866817bafedf44d3d68f55cf3394b71634b091f453b35c5204b010e45d451003
|
|
BLAKE2b-256 checksum How to use checksums |
57cf87eda11671a45169a6666cac3cddd63cdb951b2bc7f439b4b95f126e951e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency logRelease files / rustforge_rl-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rustforge_rl-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 576.6 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c709a8c552be4f78a2f4f8329bb4dd2ffa2a5f9ace9758b3f857cbadb3f4136c
|
|
BLAKE2b-256 checksum How to use checksums |
c15a274a1002fecef439dd28d46b101cad50e756d1cc8eac4fb0a6db9b1471e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency logRelease files / rustforge_rl-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rustforge_rl-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 548.3 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
23607c57eeece5d303bf069b14e4058edc64f7e3155658874fa24e57c8bf839d
|
|
BLAKE2b-256 checksum How to use checksums |
f65ed319f64bf1aa5234c9902d45535288a38adaa340fbb0eb5f37cdd3b05a80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency logRelease files / rustforge_rl-0.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | rustforge_rl-0.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 994.7 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a2bfe00fbd31de6304c1c22946a5bcd5361f74803276a76b903a504c4c8af465
|
|
BLAKE2b-256 checksum How to use checksums |
e9c7be56e649d7638232edff15451f606ca885b7e4df6d3391fb9f2879cf77fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency log