Last active
February 16, 2023 22:07
-
-
Save myersjustinc/073c13aeac1fd5a61e9d51f29f1db7fb to your computer and use it in GitHub Desktop.
Python script scaffold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import logging | |
from pathlib import Path | |
# CONSTANTS ------------------------------------------------------------------- | |
ROOT_DIR = Path(__file__).parent.resolve() | |
# COMMAND-LINE ARGUMENTS ------------------------------------------------------ | |
_parser = argparse.ArgumentParser(description='TODO') | |
_parser.add_argument('input_path', type=Path, help='TODO') | |
_parser.add_argument('output_path', type=Path, help='TODO') | |
# LOGGING SETUP --------------------------------------------------------------- | |
_LOGGER = logging.getLogger(Path(__file__).stem) | |
_LOGGER.setLevel(logging.DEBUG) | |
_handler = logging.StreamHandler() | |
_formatter = logging.Formatter( | |
'%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
_handler.setFormatter(_formatter) | |
_LOGGER.addHandler(_handler) | |
# HELPER FUNCTIONS ------------------------------------------------------------ | |
# TODO: Add these. | |
# MAIN ------------------------------------------------------------------------ | |
def main(args): | |
"""Run the overall script. | |
Args: | |
args: An argparse.Namespace with the following properties: | |
TODO | |
Returns: | |
None | |
""" | |
pass | |
if __name__ == '__main__': | |
args = _parser.parse_args() | |
main(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment