table of contents
conflicting packages
| 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¶
- -h, --help
- Show help message and exit
- -f SOURCE, --file SOURCE
- Specify input source (required). Can be either:
- A single INI file (.ini, .cf, or .conf extension)
- A directory containing INI files
- -n APP_NAME, --name APP_NAME
- Specify application name for YAML metadata. Default: 'app'
- -v VERSION, --version VERSION
- Specify configuration version. Default: '1.0.0'
- -p PATH, --path PATH
- 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)
_type: Always 's' (string type)
- •
- Output filename: <APP_NAME>.yaml
ENVIRONMENT¶
- HOME
- Determines default output directory when -p is not specified
EXAMPLES¶
- Convert single file with defaults:
- ini2yaml -f /etc/dput.cf
- Convert directory with custom parameters:
- ini2yaml -f ~/configs/ -n myapp -v 2.1.0 -p /tmp/output
- Process system configurations:
- 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 |