python script that cleans out duplicate roms from a library. most romsets have the same game as usa, europe, japan versions plus revisions and odd rereleases. this keeps one copy per game and deletes the rest.
it groups zip files by base game name, then scores each variant. usa beats world beats europe beats japan, higher revisions get a small bonus, and tags like pirate, proto, demo or virtual console get a penalty. highest score is kept, everything else goes.
set LIBRARY_PATH at the top to your rom folder, one subdirectory per console with zips inside. run it plain for a dry run that changes nothing, add --execute to actually delete. --console limits it to one console folder. arcade is skipped by default since mame sets are not real duplicates, add --include-arcade if you really want it. a log of the run is written to a text file.