How to use the fire.parser.DefaultParseValue function in fire

To help you get started, we’ve selected a few fire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skorch-dev / skorch / skorch / cli.py View on Github external
def _parse_args_kwargs(params):
    from fire.parser import DefaultParseValue

    args = ()
    kwargs = {}
    for param in _param_split(params):
        if '=' not in param:
            args += (DefaultParseValue(param),)
        else:
            k, v = param.split('=')
            kwargs[k.strip()] = DefaultParseValue(v)
    return args, kwargs
github skorch-dev / skorch / skorch / cli.py View on Github external
def _parse_args_kwargs(params):
    from fire.parser import DefaultParseValue

    args = ()
    kwargs = {}
    for param in _param_split(params):
        if '=' not in param:
            args += (DefaultParseValue(param),)
        else:
            k, v = param.split('=')
            kwargs[k.strip()] = DefaultParseValue(v)
    return args, kwargs
github sharbov / open-cli / open_cli / parser.py View on Github external
def set_nested(dictionary, value, *path):
        """Set the value in the given path to the given nested dictionary."""
        for level in path[:-1]:
            dictionary = dictionary.setdefault(level, {})

        # Use fire parser to convert raw argument into a value
        dictionary[path[-1]] = parser.DefaultParseValue(value)