bw2 / ConfigArgParse

A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.
MIT License
719 stars 121 forks source link

Parse yaml directories as key=value pairs #258

Open SilasK opened 2 years ago

SilasK commented 2 years ago

Hellow I work on https://github.com/snakemake/snakemake/issues/1186

I would like that the YAMLConfigFileParser would parse yaml directories to key-value pairs.

config.yaml

default_resources:
  mem_mb: 10
  time:300

would be parsed to: --default_resources mem_mb=10 time=300

Do you think this is a reasonable feature request?

bw2 commented 2 years ago

I think complicated values like this with compound / non-primitive types are too complex for the main configargparse repo. You're welcome to create a subclass or fork of configargparse for these more specialized use cases.

SilasK commented 2 years ago

Could you show me where in the code I would need to check if the input is a dict.