Skip to main content
Datoso uses INI-style configuration files to manage settings across different sections. The configuration system supports both global and local configurations with a clear precedence order.

Configuration File Locations

Datoso reads configuration files in the following order, with later files overriding earlier ones:
  1. Default configuration: src/datoso/datoso.ini (bundled with Datoso)
  2. Home directory: ~/.datosorc (user-specific global config)
  3. XDG config directory: ~/.config/datoso/datoso.config (preferred global location)
  4. Current working directory: .datosorc (project-specific local config)
Configuration files are read in order, with each subsequent file overriding values from previous files. This allows you to set global defaults and override them per-project.

Configuration File Structure

The configuration file uses INI format with sections and key-value pairs:
[GENERAL]
# This is the default union character
UnionCharacter = -

[COMMAND]
# This will try to quiet output
Quiet = false
# This will show every command executed and its output
Verbose = false

[LOG]
# This will log every command executed and its output
Logging = false
LogLevel = INFO
# This is the path to the log file
LogFile = datoso.log

[PATHS]
# the relative path to the database and configuration file
DatosoPath = ~/.config/datoso
# The path for the dats inside RomVaultPath
DatPath = ~/ROMVault/DatRoot
# the name of the database file
DatabaseFile = datoso.json
# the relative path to the temporary file
DownloadPath = ~/.datoso/dats

Configuration Sections

GENERAL

General application settings.
OptionTypeDefaultDescription
UnionCharacterstring-Character used to join string elements

COMMAND

Command-line behavior settings.
OptionTypeDefaultDescription
QuietbooleanfalseSuppress output messages
VerbosebooleanfalseShow detailed command execution and output

LOG

Logging configuration.
OptionTypeDefaultDescription
LoggingbooleanfalseEnable file logging (independent of Quiet setting)
LogLevelstringINFOLogging level (DEBUG, INFO, WARNING, ERROR)
LogFilestringdatoso.logName of the log file

PREFIXES

Platform prefixes for organizing DAT files. These replace modifiers when processing.
OptionDefaultDescription
ArcadeArcadeArcade systems
AudioOther/AudioAudio devices
BookOther/BookE-book readers
CalculatorOther/CalculatorCalculators
ComputerComputerComputer systems
ConsoleConsolesConsole systems
HandheldConsolesHandheld consoles
PDAMobilePDAs
PhoneMobilePhone systems
Source CodeOther/Source CodeSource code archives
VideoOther/VideoVideo players
MobileMobileMobile devices
ManualsOther/ManualsManual collections
BIOS ImagesOther/BIOS ImagesBIOS files

IMPORT

Import operation settings.
OptionTypeDefaultDescription
IgnoreRegExregex(empty)Regular expression to ignore files during import

PROCESS

Processing behavior settings.
OptionTypeDefaultDescription
OverwritebooleanfalseOverwrite existing DAT files
DatIgnoreRegExregex.*(?:Update ROMs).*Ignore DAT files matching this pattern
SeedIgnoreRegExregex(empty)Ignore seeds matching this pattern when using all
ProcessMissingInActionbooleanfalseProcess MIA (Missing In Action) ROMs if found
MarkAllRomsInSetbooleantrueMark all ROMs in a set if one is MIA
AutoMergeEnabledbooleantrueRemove duplicates within the same DAT
ParentMergeEnabledbooleantrueRemove duplicates from parent DAT

UPDATE_URLS

External data source URLs.
OptionDefaultDescription
GoogleSheetUrlhttps://laromicas.github.io/data/systems.jsonURL for system rules configuration
GoogleSheetMIAUrlhttps://laromicas.github.io/data/mia.jsonURL for MIA data

DOWNLOAD

Download behavior settings.
OptionTypeDefaultDescription
PrefferDownloadUtilitystringwgetPreferred download tool (wget, urllib, curl, aria2c)
Workersinteger10Number of simultaneous downloads

Getting Configuration Values

Use the datoso config --get command to retrieve configuration values:
# Get the current active value
datoso config --get PATHS.DatPath

# Get value from global config only
datoso config --get PATHS.DatPath --global

# Get value from local config only
datoso config --get PATHS.DatPath --local
Configuration values are accessed using the format SECTION.Option (case-sensitive).

Setting Configuration Values

Use the datoso config --set command to modify configuration values:
# Set in global config (~/.config/datoso/datoso.config)
datoso config --set PATHS.DatPath ~/MyDats

# Set in local config (.datosorc in current directory)
datoso config --set PATHS.DatPath ~/MyDats --local
The --set command creates the configuration file if it doesn’t exist and adds the section if needed.

Environment Variables

Configuration values can be overridden using environment variables with the format SECTION.OPTION:
# Override the DatPath configuration
export PATHS.DATPATH=~/CustomDats
datoso seed redump

# Override logging settings
export LOG.LOGGING=true
export LOG.LOGLEVEL=DEBUG
datoso seed redump
Environment variables take precedence over all configuration files.

Local vs Global Configuration

Global Configuration

Global configuration affects all Datoso operations for your user account:
  • Location: ~/.config/datoso/datoso.config (preferred) or ~/.datosorc
  • Use case: System-wide defaults, paths, credentials
  • Set with: datoso config --set SECTION.Option value

Local Configuration

Local configuration is project-specific:
  • Location: .datosorc in your project directory
  • Use case: Project-specific overrides, testing settings
  • Set with: datoso config --set SECTION.Option value --local
Use local configuration files in project directories to override global settings for specific workflows or testing scenarios.

Best Practices

  1. Keep sensitive data out of config files: Use environment variables for credentials
  2. Use local configs for testing: Override settings temporarily without affecting global config
  3. Document custom settings: Add comments to explain non-standard configurations
  4. Version control: Add .datosorc to .gitignore if it contains machine-specific paths
  5. Use absolute paths: Prefix paths with ~ for home directory or use absolute paths to avoid confusion

Programmatic Access

In Python code, access configuration using the config object:
from datoso.configuration import config

# Get a string value
dat_path = config.get('PATHS', 'DatPath', fallback='~/ROMVault/DatRoot')

# Get a boolean value
verbose = config.getboolean('COMMAND', 'Verbose', fallback=False)

# Access with dictionary syntax
log_level = config['LOG']['LogLevel']
The configuration system automatically handles environment variables and file precedence.

Build docs developers (and LLMs) love