Scroll to navigation

INI2YAML(1) User Commands INI2YAML(1)

NAME

ini2yaml - convert INI configuration files to YAML format

SYNOPSIS

ini2yaml [-h] -f SOURCE [-nAPP_NAME] [-vVERSION] [-pPATH]

DESCRIPTION

This program converts INI configuration files (with extensions .ini, .cf, or .conf) into YAML format. It can process either a single file or all valid files in a directory. Output is saved in the specified directory with YAML formatting.

OPTIONS

Show help message and exit
Specify input source (required). Can be either:
  • A single INI file (.ini, .cf, or .conf extension)
  • A directory containing INI files
Specify application name for YAML metadata. Default: 'app'
Specify configuration version. Default: '1.0.0'
Specify output directory. Default: ${HOME}/yaml

PROCESSING DETAILS

  • Converts each INI section to a YAML object
  • Preserves option values while stripping surrounding quotes
  • Adds metadata fields:
_default: Original value from INI
_type: Always 's' (string type)
Output filename: <APP_NAME>.yaml

ENVIRONMENT

Determines default output directory when -p is not specified

EXAMPLES

ini2yaml -f /etc/dput.cf
ini2yaml -f ~/configs/ -n myapp -v 2.1.0 -p /tmp/output
ini2yaml -f /etc/sysconfig/ -n system_cfg

SEE ALSO

configparser(3python), PyYAML(3python)

NOTES

  • Nested INI sections are not supported
  • All values are treated as strings
  • Existing YAML files will be overwritten

AUTHOR

Written for the UKUI project.

2025-07-24 v1.0