GameFinder

GameFinder will search through files on disc, grouping up by game which includes potential duplicate ROM files (e.g. games with slightly different names in different regions)

For more details on the GameFinder arguments, see the config file documentation.

API

class romsearch.GameFinder(platform, dat=None, retool=None, ra_hashes=None, config_file=None, config=None, dupe_dict=None, platform_config=None, default_config=None, regex_config=None, logger=None, log_line_sep='=', log_line_length=100)[source]

Tool to find games within a list of files

Will parse through files to get a unique list of games, then pull out potential aliases and optionally remove things from user excluded list

Parameters:
  • platform (str) – Platform name

  • config_file (str, optional) – Path to config file. Defaults to None.

  • config (dict, optional) – Configuration dictionary. Defaults to None.

  • dupe_dict (dict, optional) – Dupe dictionary. Defaults to None.

  • default_config (dict, optional) – Default configuration dictionary. Defaults to None.

  • regex_config (dict, optional) – Dictionary of regex config. Defaults to None.

  • logger (logging.Logger, optional) – Logger instance. Defaults to None.

  • log_line_length (int, optional) – Line length of log. Defaults to 100

apply_filters(game_name, parent_name, dupe_entry, filters)[source]

Apply filters to game if conditions are met

Parameters:
  • game_name – Dictionary containing various game names

  • parent_name – Game name

  • dupe_entry – Dictionary of game properties

  • filters – Filters with conditions and results to apply

apply_results(parent_name, game_dict, results)[source]

Apply results to a filtered match

Parameters:
  • parent_name – Parent name

  • game_dict – Dictionary of game properties

  • results – Dictionary of results to apply to the game/game dict

filter_by_search_terms(game, game_dict=None)[source]

Add entries to game dict based on search term conditions

Will find possible parents, then add those to the game dict

Parameters:
  • game (dict) – Dictionary containing various game names

  • game_dict (dict) – Dictionary of games to match against. Defaults to None, which will create an empty dict

get_filter_dupes(games)[source]

Parse down a list of files based on an input dupe list

get_game_dict(files)[source]

Get a game dictionary out.

From a list of files, parse out dupes, apply includes and excludes, and return a game dictionary.

Parameters:

files (dict) – Dictionary of files with names for association

get_game_matches(game_dict, games_to_match)[source]

Get files that match an input dictionary (to properly handle dupes)

Parameters:
  • game_dict (-) – Dictionary of games to match against

  • games_to_match (-) – List of values to match against

get_parents(game_name)[source]

Get the parent(s) recursively searching through a dupe dict

Because we can have compilations, find all cases where things match up

Parameters:

game_name (dict) – game name to find parents for

run(files)[source]