ines-parser 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ines_parser-1.2.0/LICENSE +22 -0
- ines_parser-1.2.0/PKG-INFO +117 -0
- ines_parser-1.2.0/README.md +89 -0
- ines_parser-1.2.0/ines_parser/__init__.py +46 -0
- ines_parser-1.2.0/ines_parser/cli/__init__.py +0 -0
- ines_parser-1.2.0/ines_parser/cli/ines_scan_roms.py +535 -0
- ines_parser-1.2.0/ines_parser/cli/ines_split_rom.py +346 -0
- ines_parser-1.2.0/ines_parser/mappers.py +147 -0
- ines_parser-1.2.0/ines_parser/parser.py +492 -0
- ines_parser-1.2.0/ines_parser.egg-info/PKG-INFO +117 -0
- ines_parser-1.2.0/ines_parser.egg-info/SOURCES.txt +15 -0
- ines_parser-1.2.0/ines_parser.egg-info/dependency_links.txt +1 -0
- ines_parser-1.2.0/ines_parser.egg-info/entry_points.txt +3 -0
- ines_parser-1.2.0/ines_parser.egg-info/requires.txt +3 -0
- ines_parser-1.2.0/ines_parser.egg-info/top_level.txt +1 -0
- ines_parser-1.2.0/pyproject.toml +65 -0
- ines_parser-1.2.0/setup.cfg +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ines-parser
|
|
3
|
+
Version: 1.2.0
|
|
4
|
+
Summary: A Python library and utilities for parsing iNES format NES ROM files
|
|
5
|
+
Author: Leonid Kabanov
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/ponchick/ines-parser
|
|
8
|
+
Project-URL: Documentation, https://github.com/ponchick/ines-parser#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/ponchick/ines-parser.git
|
|
10
|
+
Project-URL: Issues, https://github.com/ponchick/ines-parser/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/ponchick/ines-parser/releases
|
|
12
|
+
Keywords: nes,ines,rom,parser,retro,gaming,emulation
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Topic :: Games/Entertainment
|
|
21
|
+
Classifier: Topic :: System :: Archiving
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Provides-Extra: archive
|
|
26
|
+
Requires-Dist: libarchive-c>=4.0; extra == "archive"
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# iNES Parser
|
|
30
|
+
|
|
31
|
+
Lightweight Python library and CLI tools for working with NES ROMs in iNES/NES 2.0 format.
|
|
32
|
+
|
|
33
|
+
Supported versions: Python 3.10-3.14.
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install ines-parser
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Optional extra for archive formats (`.7z`/`.zip`/`.rar`): `pip install "ines-parser[archive]"`. Otherwise the library has no extra dependencies.
|
|
42
|
+
|
|
43
|
+
## What It Does
|
|
44
|
+
|
|
45
|
+
- parses ROM headers (`mapper`, PRG/CHR sizes, mirroring, and more)
|
|
46
|
+
- scans ROM directories with filters
|
|
47
|
+
- splits ROM files into `PRG` and `CHR` binaries
|
|
48
|
+
|
|
49
|
+
## CLI
|
|
50
|
+
|
|
51
|
+
Tools live in **`ines_parser/cli/`** as **`ines_scan_roms.py`** and **`ines_split_rom.py`**. The names match **`pip install`** entry points on your `PATH`: **`ines_scan_roms.py`** and **`ines_split_rom.py`**.
|
|
52
|
+
|
|
53
|
+
**Without installing**, from the repository root you can use either `-m` or the path to the same files:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python -m ines_parser.cli.ines_scan_roms /path/to/roms
|
|
57
|
+
python ines_parser/cli/ines_scan_roms.py /path/to/roms
|
|
58
|
+
|
|
59
|
+
python -m ines_parser.cli.ines_split_rom game.nes
|
|
60
|
+
python ines_parser/cli/ines_split_rom.py game.nes
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**After `pip install`,** run the same logical names as commands (they are small wrappers, not copies of the sources):
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
ines_scan_roms.py /path/to/roms
|
|
67
|
+
ines_split_rom.py game.nes
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Scan ROMs
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
ines_scan_roms.py /path/to/roms
|
|
74
|
+
ines_scan_roms.py /path/to/roms --mapper 4
|
|
75
|
+
ines_scan_roms.py /path/to/roms --show-all
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Useful filters:
|
|
79
|
+
|
|
80
|
+
- `--mapper N`
|
|
81
|
+
- `--mirroring H|V|F`
|
|
82
|
+
- `--has-trainer`
|
|
83
|
+
- `--min-prg KiB`, `--max-prg KiB`
|
|
84
|
+
- `--min-chr KiB`, `--max-chr KiB`
|
|
85
|
+
|
|
86
|
+
### Split ROM (PRG / CHR)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
ines_split_rom.py game.nes
|
|
90
|
+
ines_split_rom.py roms.7z
|
|
91
|
+
ines_split_rom.py game.nes --force
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
By default, existing output files are not overwritten without confirmation.
|
|
95
|
+
|
|
96
|
+
## Library Usage
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from ines_parser import parse_ines_header
|
|
100
|
+
|
|
101
|
+
with open("game.nes", "rb") as f:
|
|
102
|
+
header = parse_ines_header(f.read(16))
|
|
103
|
+
|
|
104
|
+
if header and header.is_valid():
|
|
105
|
+
print(header) # compact output
|
|
106
|
+
print(header.detailed_str()) # full output
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Format Docs
|
|
110
|
+
|
|
111
|
+
- Details: `docs/iNES.md`
|
|
112
|
+
- Spec: [NESdev iNES](https://www.nesdev.org/wiki/INES)
|
|
113
|
+
- NES 2.0: [NESdev NES 2.0](https://www.nesdev.org/wiki/NES_2.0)
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT, see `LICENSE`.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# iNES Parser
|
|
2
|
+
|
|
3
|
+
Lightweight Python library and CLI tools for working with NES ROMs in iNES/NES 2.0 format.
|
|
4
|
+
|
|
5
|
+
Supported versions: Python 3.10-3.14.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install ines-parser
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Optional extra for archive formats (`.7z`/`.zip`/`.rar`): `pip install "ines-parser[archive]"`. Otherwise the library has no extra dependencies.
|
|
14
|
+
|
|
15
|
+
## What It Does
|
|
16
|
+
|
|
17
|
+
- parses ROM headers (`mapper`, PRG/CHR sizes, mirroring, and more)
|
|
18
|
+
- scans ROM directories with filters
|
|
19
|
+
- splits ROM files into `PRG` and `CHR` binaries
|
|
20
|
+
|
|
21
|
+
## CLI
|
|
22
|
+
|
|
23
|
+
Tools live in **`ines_parser/cli/`** as **`ines_scan_roms.py`** and **`ines_split_rom.py`**. The names match **`pip install`** entry points on your `PATH`: **`ines_scan_roms.py`** and **`ines_split_rom.py`**.
|
|
24
|
+
|
|
25
|
+
**Without installing**, from the repository root you can use either `-m` or the path to the same files:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python -m ines_parser.cli.ines_scan_roms /path/to/roms
|
|
29
|
+
python ines_parser/cli/ines_scan_roms.py /path/to/roms
|
|
30
|
+
|
|
31
|
+
python -m ines_parser.cli.ines_split_rom game.nes
|
|
32
|
+
python ines_parser/cli/ines_split_rom.py game.nes
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**After `pip install`,** run the same logical names as commands (they are small wrappers, not copies of the sources):
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ines_scan_roms.py /path/to/roms
|
|
39
|
+
ines_split_rom.py game.nes
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Scan ROMs
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
ines_scan_roms.py /path/to/roms
|
|
46
|
+
ines_scan_roms.py /path/to/roms --mapper 4
|
|
47
|
+
ines_scan_roms.py /path/to/roms --show-all
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Useful filters:
|
|
51
|
+
|
|
52
|
+
- `--mapper N`
|
|
53
|
+
- `--mirroring H|V|F`
|
|
54
|
+
- `--has-trainer`
|
|
55
|
+
- `--min-prg KiB`, `--max-prg KiB`
|
|
56
|
+
- `--min-chr KiB`, `--max-chr KiB`
|
|
57
|
+
|
|
58
|
+
### Split ROM (PRG / CHR)
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
ines_split_rom.py game.nes
|
|
62
|
+
ines_split_rom.py roms.7z
|
|
63
|
+
ines_split_rom.py game.nes --force
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
By default, existing output files are not overwritten without confirmation.
|
|
67
|
+
|
|
68
|
+
## Library Usage
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from ines_parser import parse_ines_header
|
|
72
|
+
|
|
73
|
+
with open("game.nes", "rb") as f:
|
|
74
|
+
header = parse_ines_header(f.read(16))
|
|
75
|
+
|
|
76
|
+
if header and header.is_valid():
|
|
77
|
+
print(header) # compact output
|
|
78
|
+
print(header.detailed_str()) # full output
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Format Docs
|
|
82
|
+
|
|
83
|
+
- Details: `docs/iNES.md`
|
|
84
|
+
- Spec: [NESdev iNES](https://www.nesdev.org/wiki/INES)
|
|
85
|
+
- NES 2.0: [NESdev NES 2.0](https://www.nesdev.org/wiki/NES_2.0)
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT, see `LICENSE`.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""
|
|
2
|
+
iNES Parser Library
|
|
3
|
+
|
|
4
|
+
A Python library for parsing iNES format NES ROM files.
|
|
5
|
+
Supports iNES 1.0, NES 2.0, Archaic iNES formats, and UNIF detection.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .parser import (
|
|
9
|
+
parse_ines_header,
|
|
10
|
+
INESHeader,
|
|
11
|
+
INESFormat,
|
|
12
|
+
Mirroring,
|
|
13
|
+
TVSystem,
|
|
14
|
+
ConsoleType,
|
|
15
|
+
CPUTiming,
|
|
16
|
+
INES_HEADER_SIZE,
|
|
17
|
+
INES_TRAINER_SIZE,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from .mappers import (
|
|
21
|
+
get_mapper_name,
|
|
22
|
+
get_mapper_alternate_names,
|
|
23
|
+
get_mapper_notes,
|
|
24
|
+
get_mapper_info,
|
|
25
|
+
is_known_mapper,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
__version__ = "1.2.0"
|
|
29
|
+
__author__ = "Leonid Kabanov"
|
|
30
|
+
__all__ = [
|
|
31
|
+
"parse_ines_header",
|
|
32
|
+
"INESHeader",
|
|
33
|
+
"INESFormat",
|
|
34
|
+
"Mirroring",
|
|
35
|
+
"TVSystem",
|
|
36
|
+
"ConsoleType",
|
|
37
|
+
"CPUTiming",
|
|
38
|
+
"INES_HEADER_SIZE",
|
|
39
|
+
"INES_TRAINER_SIZE",
|
|
40
|
+
"get_mapper_name",
|
|
41
|
+
"get_mapper_alternate_names",
|
|
42
|
+
"get_mapper_notes",
|
|
43
|
+
"get_mapper_info",
|
|
44
|
+
"is_known_mapper",
|
|
45
|
+
]
|
|
46
|
+
|
|
File without changes
|