Metadata-Version: 2.4
Name: ines-parser
Version: 1.3.0
Summary: Parse iNES/NES 2.0 ROM headers; CLI to scan, export, summarize, and split ROMs
Author: Leonid Kabanov
License-Expression: MIT
Project-URL: Homepage, https://github.com/ponchick/ines-parser
Project-URL: Documentation, https://github.com/ponchick/ines-parser#readme
Project-URL: Repository, https://github.com/ponchick/ines-parser.git
Project-URL: Issues, https://github.com/ponchick/ines-parser/issues
Project-URL: Changelog, https://github.com/ponchick/ines-parser/releases
Keywords: nes,ines,rom,parser,retro,gaming,emulation
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: System :: Archiving
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: archive
Requires-Dist: libarchive-c>=4.0; extra == "archive"
Dynamic: license-file

# iNES Parser

Python library and CLI for NES ROMs in iNES / NES 2.0 format: parse headers, scan collections, export reports, summarize mappers, and split PRG/CHR. Requires Python 3.10+.

```bash
pip install ines-parser
pip install "ines-parser[archive]"   # optional: .7z / .zip / .rar
```

## CLI

After install the tools are on your `PATH`. From a checkout:

```bash
ines_scan_roms.py /path/to/roms
# or: python -m ines_parser.cli.ines_scan_roms /path/to/roms
```

Same idea for `ines_rom_stats.py` and `ines_split_rom.py`.

### Scan

```bash
ines_scan_roms.py /path/to/roms
ines_scan_roms.py /a /b --mapper 4 --show-all
ines_scan_roms.py /path/to/roms --format csv -o roms.csv
ines_scan_roms.py /path/to/roms --format csv -d ';' -o roms.csv
ines_scan_roms.py /path/to/roms --format csv --show-all -o roms-full.csv
```

Filters: `--mapper`, `--mirroring H|V|F`, `--has-trainer`, `--min-prg` / `--max-prg`, `--min-chr` / `--max-chr` (KiB).

`--format text|html|csv|json` (default text). `-o` writes to a file. `--show-all` adds full header fields. For CSV, `-d` / `--delimiter` sets the separator (default `,`; use `;` for Excel with Russian locale, `tab` for TSV-style).

### Stats

```bash
ines_rom_stats.py /path/to/roms
ines_rom_stats.py /path/to/roms --json
```

### Split

```bash
ines_split_rom.py game.nes
ines_split_rom.py roms.7z          # prompts before overwrite; use --force to skip
```

## Library

```python
from ines_parser import parse_ines_header

with open("game.nes", "rb") as f:
    header = parse_ines_header(f.read(16))

if header and header.is_valid():
    print(header)
    print(header.detailed_str())
```

## Docs

- `docs/iNES.md`
- [NESdev iNES](https://www.nesdev.org/wiki/INES)
- [NESdev NES 2.0](https://www.nesdev.org/wiki/NES_2.0)

## License

MIT — see `LICENSE`.
