TetaNES-Py - Python bindings for the TetaNES NES emulator with Gymnasium support
Project description
tetanes-py
Python bindings for TetaNES - a NES emulator written in Rust.
Install
pip install tetanes-py
Or from source:
pip install git+https://github.com/alexeiquickcode/tetanes.git#subdirectory=tetanes-python
Usage
Basic emulator usage:
import tetanes_py
# Create emulator
env = tetanes_py.NesEnv(headless=True)
# Load ROM from file
with open("game.nes", "rb") as f:
rom_data = f.read()
env.load_rom("game.nes", rom_data)
# Step through frames
obs = env.step(0) # 0 = no button pressed
Gymnasium Environment
Works with OpenAI Gym/Gymnasium for RL:
import gymnasium as gym
import tetanes_py
env = gym.make("ExampleGame-v0", rom_path="game.nes")
obs, info = env.reset()
for _ in range(1000):
action = env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
obs, info = env.reset()
Requirements
- Python 3.9+
- NumPy
- Gymnasium (optional, for RL environment)
License
MIT OR Apache-2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 tetanes_py-0.1.2-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: tetanes_py-0.1.2-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 350.3 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd0fc1d59db40137215af6408b75b9289fa0d9348b3d9cace544e50d4385856
|
|
| MD5 |
fc4d051abcdf8cbb3d7cf535620ffe35
|
|
| BLAKE2b-256 |
4243b8b919c5c585b25d3931ced770d33d0bd1275a23bff7031ebe4217d7c58e
|
File details
Details for the file tetanes_py-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: tetanes_py-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 480.2 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4448a4e509eea6ed8e5f5bc20c8e601117307ea07bdb8022b87949ae803a350
|
|
| MD5 |
b7aa8cf561145755feaf6c69ffd87e62
|
|
| BLAKE2b-256 |
f25d5183e37e753fed95a88f62687e6e61d04ea0f989d77f3cacde9033ca6a8b
|
File details
Details for the file tetanes_py-0.1.2-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tetanes_py-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 433.7 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99df0898c6fab2db7ab207babcfc79a33335db49bdb26ddf1a083b0ae76b1995
|
|
| MD5 |
0f120464ff6f3d8fa8af74a8ca6a33b5
|
|
| BLAKE2b-256 |
2532eff101df3e71bce9c32fc154c26e4a77513c892471deab15a08bab32b7c6
|