opthandler

Python functions to parse and handle command-line and config-file options.

Functions

configparser2dict

Create a dictionary from a ConfigParser.

configparser_check_options

Check if the options of a ConfigParser are contained in a list of known options.

conv_argparse_opts

Convert the option names in an argparse.Namespace.

conv_configparser_opts

Convert the option names of a ConfigParser.

conv_configparser_vals

Convert the values of a ConfigParser.

convert_str

Convert the input to its corresponding type.

get_opts

Gather all options from command line and Configuration File.

optdict2list

Convert an option dictionary to an option list.

optdict2str

Convert an option dictionary to an option string.

optlist2dict

Convert an option list to an option dictionary.

posargs2str

Convert a list of positional arguments to a string.

read_config

Search and read options from a Configuration File.

rm_option

Remove an option from a command string.

str2none

Convert the string 'None' to the NoneType None.