Interact with OpenRCT2 from python!
Project description
pyrct2
Python client for OpenRCT2. Launch headless games, read state, execute actions, all in Python!
Connects to the openrct2-bridge plugin over TCP. Every game action, state query, and enum is auto-generated from OpenRCT2 C++ source by openrct2-codegen.
Install
pip install pyrct2
pyrct2 setup # finds OpenRCT2, installs the bridge plugin
Usage
from pyrct2.client import RCT2
from pyrct2.scenarios import Scenario
from pyrct2.enums import ResearchFundingLevel, ResearchCategory
with RCT2.launch(Scenario.CRAZY_CASTLE) as game:
# high-level API — read properties, call methods
print(f"{game.park.name}: rating {game.park.rating}, cash ${game.park.finance.cash}")
game.park.finance.set_entrance_fee(50)
game.park.cheats.sandbox_mode()
game.park.research.set_funding(ResearchFundingLevel.MAXIMUM)
game.park.research.set_priorities([ResearchCategory.ROLLERCOASTER, ResearchCategory.THRILL])
# tick-step the simulation forward
game.advance_ticks(100)
print(f"Weather: {game.park.climate.weather}")
# raw API always available as escape hatch
game.actions.staff_hire_new(auto_position=True, staff_type=0, costume_index=0, staff_orders=0)
park = game.state.park() # full Pydantic model
# or attach to an already-running instance
with RCT2.connect() as game:
print(game.park.name)
Requirements
- Python 3.11+
- OpenRCT2 installed with RCT2 game data
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrct2-0.5.1.tar.gz.
File metadata
- Download URL: pyrct2-0.5.1.tar.gz
- Upload date:
- Size: 80.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02a97a65a763412d212586bd55ada6d0f79e547817c9df7c7a251ead4d5b07a7
|
|
| MD5 |
8b267c25a89214ecf8c49f4740498a07
|
|
| BLAKE2b-256 |
f72c88fe5a484de2fb83d5582f4a8a4a69ae018af5276cd66ff389d8a0bef797
|
Provenance
The following attestation bundles were made for pyrct2-0.5.1.tar.gz:
Publisher:
publish.yml on MaukWM/pyrct2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrct2-0.5.1.tar.gz -
Subject digest:
02a97a65a763412d212586bd55ada6d0f79e547817c9df7c7a251ead4d5b07a7 - Sigstore transparency entry: 1191322688
- Sigstore integration time:
-
Permalink:
MaukWM/pyrct2@ea9d5c7fc620679902c3956ea3402bf815327210 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/MaukWM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea9d5c7fc620679902c3956ea3402bf815327210 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyrct2-0.5.1-py3-none-any.whl.
File metadata
- Download URL: pyrct2-0.5.1-py3-none-any.whl
- Upload date:
- Size: 45.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0761caebe4b051a004a93f2faba0fcad3556ea283ca22a1d0b75b4b1651f8cfe
|
|
| MD5 |
bd55675db963d2917fadbb4e8782abe8
|
|
| BLAKE2b-256 |
f389fc1c1cf0b6cc663c7637e066ea9d93e06873fb16971a87a374ef0e03c891
|
Provenance
The following attestation bundles were made for pyrct2-0.5.1-py3-none-any.whl:
Publisher:
publish.yml on MaukWM/pyrct2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrct2-0.5.1-py3-none-any.whl -
Subject digest:
0761caebe4b051a004a93f2faba0fcad3556ea283ca22a1d0b75b4b1651f8cfe - Sigstore transparency entry: 1191322699
- Sigstore integration time:
-
Permalink:
MaukWM/pyrct2@ea9d5c7fc620679902c3956ea3402bf815327210 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/MaukWM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea9d5c7fc620679902c3956ea3402bf815327210 -
Trigger Event:
release
-
Statement type: