RAHasher
The RAHasher will download a list of compatible ROM hashes from RetroAchievements to flag ROMs that have achievements.
This requires API access, so you need to supply your RA username and API key. For how to do this, see
this page. Because GetGameList is heavy on the API,
there is a cache implemented that by default will only query the full game list once a day, and will check
if anything’s changed from hashes you might already have on disk. If you need to change this, you can with
cache_period, but do so at your own risk!
For more details on the RAHasher arguments, see the config file documentation.
API
- class romsearch.RAHasher(platform, config_file=None, config=None, platform_config=None, logger=None, log_line_sep='=', log_line_length=100)[source]
Get supported ROM files and hashes for RetroAchievements
This works per-platform, so must be specified here
- Parameters:
platform (str) – Platform name
config_file (str, optional) – Path to config file. Defaults to None.
config (dict, optional) – Configuration dictionary. Defaults to None.
platform_config (dict, optional) – Platform configuration dictionary. Defaults to None
logger (logging.Logger, optional) – Logger instance. Defaults to None.
log_line_length (int, optional) – Line length of log. Defaults to 100
- download_ra_game_list(out_file)[source]
Download the RA GameList using the API
- Parameters:
out_file (string) – output file name.
- format_game_list(in_file, ra_game_info=None, sleep_time=0.5)[source]
Format the GameList neatly
- Parameters:
in_file (str) – Input GameList file
ra_game_info (dict) – RA game info. Defaults to None, which will use an empty dictionary
sleep_time (float) – Sleep time for API queries. Defaults to 0.5
- get_game_hash(game_id)[source]
Using a game ID, get list of the game hashes
- get_ra_game_info()[source]
Download or read in RA game info.
- run()[source]
Run the RA hasher
- run_rahasher()[source]
The main meat of running the RA hasher
- save_ra_game_info(ra_game_info, out_file)[source]
Save out the RA game info to a file
- Parameters:
ra_game_info (dict) – RA game info
out_file (string) – output file name