This helper class automatically parses the arguments received by the Python script via
sys.argv, using the set of key-value parameters received on its constructor to cast the types
and define the defaults.
Parameters
----------
kwargs
A set of key-values with the defaults, or the types of the expected values. For instance, it is valid to do
both:
key1 = 32.
key2 = float
For the first case - a value -, if no value is passed via sys.argv, this will be the default. Otherwise,
its type (float) will be used to cast the received value.
For the second case - a type -, if no value is passed via sys.argv, the parameter will default to None.
Otherwise, the type will be used to cast the received value.
Callables are also accepted. They should accept to be called with no parameters, returning the default,
or with a single string, returning the parsed value.
Values can be accessed later as attributes:
instance.key1 and instance.key2
Raises
------
ValueError
If the cast of the parameter failed (i.e. an invalid integer or float format)
KeyError
If additional unknown parameters are received
Definition at line 22 of file argv.py.