No doc on how to retrieve the final key:value pair when keys are overridden
Your doc says this:
"command-line, config file, env var, and default settings can now be defined, documented, and parsed in one go using a single API (if a value is specified in more than one way then: command line > environment variables > config file values > defaults)"
but you don't give a single example of retrieving a single key's value that is overridden. Could you do that.
Use an example where a key is defined as an environment variable and then within a YAML file (assume it is an unknown key, i.e. not defined to the parser). How do you retrieve the appropriate value?
I don't see any code that merges all the different values read to get one set of key:value pairs from which to read (including unknown values read from a config file; it seems that is the crux of the problem since you do merge known values). If that code exists could you specify how to get to that. It seems like the namespace returned is only a subset of the keys read rather than all of them merged by priority together, which seems like the purpose of the library in the first place. Am I missing something?
For example, if I call parse_unknown_args with some command-line args and a YAML file, I get back a Namespace with known command-line key=value pairs and a list of key, value pairs with the keys converted to command-line style arguments with '--' prepended (why is this not a dictionary?). But what I need is a flattened list of key:value pairs to utilize in the program adhering to the priority levels you have laid out. Of course, I can manually write code to figure this out but I would expect this would be solved once within your library, given the documentation you listed.
Thanks for any help.
I managed to solve this for my own use case but it involved looking at all the data structures, converting to dictionaries where needed and then merging the keys appropriately. You really should provide a single abstraction that provides a flattened dictionary or Namespace with the keys that are active regardless of whether they are known or unknown or what their source. Then this would be incredibly useful.