Skip to main content

Rusty Runways — Python Bindings

Docs PyPI

Rusty Runways

Deterministic airline logistics simulation written in Rust with a rich Python API for scripting, analysis, and RL/ML. Includes fast vectorized environments and optional Gymnasium wrappers.

— Full docs: https://dennislent.github.io/RustyRunways

Install

Python (PyPI):

pip install rusty-runways

# Optional Gym wrappers
pip install 'rusty-runways[gym]'

Local dev (build from source):

cd crates/py
maturin develop --release

Quick Start (Python)

Engine bindings (single and vector):

from rusty_runways_py import GameEnv, VectorGameEnv

g = GameEnv(seed=1, num_airports=5, cash=1_000_000)
g.step(1)
print(g.time(), g.cash())

venv = VectorGameEnv(4, seed=1)
venv.step_all(1, parallel=True)
print(venv.times())

Notes:

  • Seeds control determinism.
  • VectorGameEnv.step_all(..., parallel=True) releases the GIL and uses Rayon under the hood.

Gymnasium Wrappers (optional)

Wrappers live in the pure‑Python package rusty_runways and require gymnasium:

from stable_baselines3 import PPO
from stable_baselines3.common.vec_env import DummyVecEnv
from rusty_runways import RustyRunwaysGymEnv, make_sb3_envs

# Single‑env Gym
env = RustyRunwaysGymEnv(seed=1, num_airports=5)

# SB3 convenience (DummyVecEnv)
vec_env = DummyVecEnv(make_sb3_envs(4, seed=1, num_airports=5))
model = PPO("MlpPolicy", vec_env, verbose=1)
model.learn(total_timesteps=10_000)

YAML Worlds and Custom Airplanes

All constructors accept a config_path pointing to a YAML world. The YAML can optionally define an airplanes catalog to replace or extend the built‑in models. Example:

seed: 42
starting_cash: 650000.0
airports: [ ... ]
airplanes:
  strategy: replace   # or: add (default)
  models:
    - name: WorkshopCombi
      mtow: 15000.0
      cruise_speed: 520.0
      fuel_capacity: 3200.0
      fuel_consumption: 260.0
      operating_cost: 950.0
      payload_capacity: 3200.0
      passenger_capacity: 24
      purchase_price: 780000.0
      min_runway_length: 1200.0
      role: Mixed        # Cargo | Passenger | Mixed

From Python:

from rusty_runways_py import GameEnv

g = GameEnv(config_path="examples/sample_world.yaml")
# List the models the current game exposes (custom + built‑ins depending on strategy)
print(g.models_py())       # Python list of dicts
print(g.models_json())     # JSON string

Validation ensures all fields are present and role constraints hold (Cargo requires payload_capacity > 0; Passenger requires passenger_capacity > 0; Mixed requires both).

License: MIT

Metadata

Release files for rusty-runways 3.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rusty-runways 3.0.2
File Size Uploaded
rusty_runways-3.0.2.tar.gz 128.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rusty-runways 3.0.2
File Interpreter ABI Platform
rusty_runways-3.0.2-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
rusty_runways-3.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
rusty_runways-3.0.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 2.9 MB

Release files / rusty_runways-3.0.2.tar.gz

Download URL rusty_runways-3.0.2.tar.gz
Size 128.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b343216ed5203191cd446dc8170e27bf05f1d7390784ce5bd8453c3976ff329e
BLAKE2b-256 checksum
How to use checksums
3210365f4c8e8ffda1a184d48422c3e9391c73ea0d81411ac2bd631b259dc663
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.3

Release files / rusty_runways-3.0.2-cp38-abi3-win_amd64.whl

Download URL rusty_runways-3.0.2-cp38-abi3-win_amd64.whl
Size 641.2 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5012a8541c37796450390add904ecb498c4e026908ae612d2c4537e6319a812b
BLAKE2b-256 checksum
How to use checksums
5637723d84970ed66faf88dd7bb2d77e88f6d91eb498c6fa1b1672b6f56447a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.3

Release files / rusty_runways-3.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rusty_runways-3.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 740.8 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
4ae9b5a39afcdecb71757f957d99c15a0bd8ee96cdacd727689b23a7d5aff17c
BLAKE2b-256 checksum
How to use checksums
9b9beed60e1ea53fbb63fc28f07908b5a2882ae2ec0f2c27fb936b4817894df0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.3

Release files / rusty_runways-3.0.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL rusty_runways-3.0.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 1.4 MB
Tags CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3787f17d4adc7330af0ef80ec1d319d86225e873c499aac156dd2f26b9bdab9b
BLAKE2b-256 checksum
How to use checksums
601649af426ab93b642c0c46384d6d2245dab926c8b9957ac335cea2ee34cd94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.9.3

Release history Release notifications | RSS feed

This release

3.0.2 This release

4 release files

3.0.1

4 release files

2.2.1

4 release files

2.0.4

4 release files

2.0.3

4 release files

2.0.2

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page