The congressclient.common.parseractions Module

argparse Custom Actions

class congressclient.common.parseractions.KeyValueAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: argparse.Action

A custom action to parse arguments as key=value pairs

Ensures that dest is a dict

class congressclient.common.parseractions.RangeAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: argparse.Action

A custom action to parse a single value or a range of values

Parses single integer values or a range of integer values delimited by a colon and returns a tuple of integers: ‘4’ sets dest to (4, 4) ‘6:9’ sets dest to (6, 9)