Ok here they are, and I'll spare you the usual disclaimer
Anyway, these scripts require python 3.x and have only been tested by me on Windows. Don't hesitate with bugs / remarks / suggestions / help.
Let start with the most simple one; cleaning the mame.xml file of games for which you do not have a rom.
usage: mame_xmlcleaner.py [-h] [--debug] rompath input output
Makes a copy of mame.xml that is stripped of all information about non-
existing roms. The script makes a line-by-line copy, using regular expressions
to match the start and end of each game section. As a result, the input XML
needs to be properly formatted. Meaning each start and end XML element must be
placed on its own line. The only exception being XML elments without children.
This script will also output all roms that were not present in mame.xml
positional arguments:
rompath path to a folder containing roms
input input MAME XML file path
output cleaned MAME XML file path
optional arguments:
-h, --help show this help message and exit
--debug output debug information
Next up is converting the, possibly cleaned, mame.xml file into a CSV file. Note that the top of the scripts contains two containers that basically define what data is converted: xml_elements, xml_attributes. Feel free to comment out stuff that you are not interested in, or add stuff that is missing.
usage: mame_xml2csv.py [-h] input output
Outputs game information from the mame.xml file in csv format. Also uses
catver.ini, nplayers.ini, controls.ini if available. The main purpose of this
script is to allow for fast game searching and filtering using your
spreadsheet program of choice. The script is setup in such a way that it can
be easily changed to collect only that data that you are interested in.
positional arguments:
input input MAME XML file path
output output CSV file path
optional arguments:
-h, --help show this help message and exit
Using the csv file, you can use a spreadsheet program of choice to perform filtering. If you save the result you can then use this script to copy/delete/move the corresponding roms and related files. The script will also work with a 'rom names only' list as saved by Romlister. The only downside of this is that you will not be able to process parent roms, as that information is not present. Note that if you do not specify -d/-c/-m the script will just output all matching files and folders. Always do this 'dry-run' first to examine what files the script will process.
usage: mame_filemgr.py [-h] [-p] [-r] [-d | -c path | -m path] [--debug]
romlist source
Copy / move / delete roms and related files. Only those files that correspond
to roms listed in an input file are processed. This list can be a csv file as
generated by mame_xml2csv.py, or a 'rom names only' list as generated by
Romlister.
positional arguments:
romlist csv file containing rom names; requires a header with
column 'name' (configurable at the top of the script)
or assumes the first column contains rom names
source directory containing roms and related files (images,
videos)
optional arguments:
-h, --help show this help message and exit
-p, --parents include parent roms; requires 'romlist' to contain
columns with parent rom names (configurable at the top
of the script)
-r, --recursive recursively process sub-directories of 'source'
-d, --delete delete all matching files
-c path, --copy path copy all matching files to specified path
-m path, --move path move all matching files to specified path
--debug output debug information
And a script for reducing no-intro rom sets. This script will need a 'dat-o-matic parent/clone' text file that matches (as close as possible) your romset. You can download these from
http://datomatic.no-intro.org/. Any roms that you have, but that are not listed in the 'parent/clone' file are output by this script. If this happens the romset and 'parent/clone' list are probably of different versions.
usage: romset_cleaner.py [-h] -r order [-i] -p path [-c path]
(--no-intro | --goodset) [--debug]
rompath
Reduce rom sets by keeping only a single rom per game title, based on a user
supplied region preference; Bios files are always kept, and all crap
(beta/hacks/prototypes/etc) is always discarded. Note that roms are never
actually removed, instead all roms that should be kept are either output or
copied to a separate folder.
positional arguments:
rompath folder containing roms
optional arguments:
-h, --help show this help message and exit
-r order, --region order
region preference, where W=World, U=USA, E=Europe,
J=Japan, O=Other; used to pick a single region for
each rom, f.e. J,E would pick the Japan version over
the Europe version, all other (non-listed) regions are
discarded
-i, --inverse inverse the result; shows all non-matching roms
-p path, --pc-list path
dat-o-matic parent/clone txt file
-c path, --copy path copy all matching roms to specified path
--no-intro use no-intro naming convention
--goodset use goodset naming convention (not yet implemented)
--debug output debug information