Hi there,
Stumbled upon this repo while trying to do something similar. I see you guys are using optparse currently. Would you like a PR submitted that updates this to argparse? optparse has been deprecated in favor of argparse.
lmk if you're interested, I can submit a PR!