DATParser
The DATParser parses .dat files (either from Redump or No-Intro) to pull out useful information about ROM files.
For Redump, ROMSearch can automatically download the latest .dat file from their site. This is not possible for No-Intro, so users will have to download this file manually.
For more details on the DATParser arguments, see the config file documentation.
API
- class romsearch.DATParser(platform=None, use_subchannels=False, config_file=None, config=None, platform_config=None, logger=None, log_line_sep='=', log_line_length=100)[source]
Parser for dat files from Redump or No-Intro
For Redump dats, we can download directly from the site. Users will have to provide their own files for No-Intro, since there’s no good way to scrape them automatically
- Parameters:
platform (str, optional) – Platform name. Defaults to None, which will throw a ValueError
use_subchannels (bool, optional) – Whether to get dats for subchannels. Defaults to False.
config_file (str, optional) – Configuration 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_latest_redump_dat(subchannel=None)[source]
Download Redump zip file for the platform
- Parameters:
subchannel – Specific subchannel. Defaults to None, which will use the main dat
- get_zip_file(subchannel=None)[source]
Get zip file from the dat directory
If this is a Redump file, we can download the latest directly from the site. Otherwise, you will need to download them manually
- Parameters:
subchannel – Specific subchannel. Defaults to None, which will use the main dat
- run()[source]
- run_datparser()[source]
The main meat of running the dat parser
- save_rom_dict(rom_dict)[source]
Save the dat file parsed as a dictionary to JSON