Skip to content

Instantly share code, notes, and snippets.

av8rgeek /
Created October 26, 2023 19:52
Pass key/value pairs to a python script using CLI arguments using Argparse
Sample script to parse arguments in the form of foo=bar and return a dict value
import argparse
class ParseTags(argparse.Action):
This class overrides the argparse.Action __call__ method to evaluate
the arguments, create a dict, and then return that dict as the argument's