Metadata-Version: 2.4
Name: tetanes-py
Version: 0.1.6
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: numpy>=1.20.0
Requires-Dist: gymnasium>=0.26.0
Provides-Extra: dev
Provides-Extra: examples
Summary: TetaNES-Py - Python bindings for the TetaNES NES emulator with Gymnasium support
Home-Page: https://lukeworks.tech/tetanes
Author-email: Alexei Quick <alexei.quick@gmail.com>
License: MIT OR Apache-2.0
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# tetanes-py

Python bindings for TetaNES - a NES emulator written in Rust.

## Install

```bash
pip install tetanes-py
```

Or from source:
```bash
pip install git+https://github.com/alexeiquickcode/tetanes.git#subdirectory=tetanes-python
```

## Usage

Basic emulator usage:

```python
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:

```python
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

