I am an intermediate level Python Programmer and I have written a Python program that scrapes Mutual Fun NAV data from a web site and inserts those into a database.
The code is around 176 lines long and has logic related to command line option processing using the argparse module and logging logic using the logger module.
Right now the entire logic around command line option processing and logging is part of the main() loop. Should the logic for these be encapsulated in their own little functions or be part of main?
What do proper design principles require?
My favorite template to separating logging, argument parsing and the essential work of a script or application.