Skip to main content

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tetanes_py-0.1.3-cp38-abi3-win_amd64.whl (351.4 kB view details)

Uploaded CPython 3.8+Windows x86-64

tetanes_py-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (481.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

tetanes_py-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (434.6 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file tetanes_py-0.1.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: tetanes_py-0.1.3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 351.4 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

Hashes for tetanes_py-0.1.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4a58830d1a263d82e04e7dbb042542e6d1c50e912f0738ccb9119124867467ea
MD5 3d61dfd808c9834f518c60af95b25aed
BLAKE2b-256 5aece99327ca6d46868d0856dd2f2ea5f5d5fcf96e8b0aae4a3693e871c60ba3

See more details on using hashes here.

File details

Details for the file tetanes_py-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tetanes_py-0.1.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 12b21c8efe1d8a45185a2dc1910b0a8b3b4a36664c7f97f4f88d60b8452fe06f
MD5 207566a5a02bf9430bd4c8c73914d3f0
BLAKE2b-256 9a147475586f8d21bb07602e945fce8f2598a2edc09d26fc9f69f4bd9218a048

See more details on using hashes here.

File details

Details for the file tetanes_py-0.1.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tetanes_py-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41fc4ffa49841ef373f591101a918588e9ad4a0a4690a2151f4be9a63c5dcbba
MD5 d6abb60942e7051dc2268c5ffc459a3a
BLAKE2b-256 3fdffbbb4e6ff2a2e51163870d598f42a3c0f2d9d0cc90bf74ffe5250b0a2f56

See more details on using hashes here.

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