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.8-cp38-abi3-win_amd64.whl (353.1 kB view details)

Uploaded CPython 3.8+Windows x86-64

tetanes_py-0.1.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.1 kB view details)

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

tetanes_py-0.1.8-cp38-abi3-macosx_11_0_arm64.whl (437.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: tetanes_py-0.1.8-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 353.1 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.8-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3ef24894ffd7eafa95076055fde1f28254ea91b44e415b1f3806f0cbc457263c
MD5 91cb24d460268c3228a87ea4c11847c1
BLAKE2b-256 fa350bc7068d7a7c28b5666ac333462d73bb84cee7e9002f799993693ffae6da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tetanes_py-0.1.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3690dd48006d66c3eae9a95658cff54187d5796691b6d8404b397fd1fcea371a
MD5 5dcddf13e05b9f97ce25a19d9bddffec
BLAKE2b-256 c79a1f0759b06b07a85f3728ae759997320320458174aa4e8d4db64bd920a85c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tetanes_py-0.1.8-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0ef41c9cf8df98889e0da71e0334f2751b3b4b49d3dc5631a6ff2153e446027
MD5 20d30ad041b57f05508962ca1bac749e
BLAKE2b-256 c91e52407e1494efe923ac7d23e5e9d43bc7fce2724913f8549762a73dbfa694

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