CLI argument parsing

This commit is contained in:
Jeff Moe 2024-09-19 12:20:47 -06:00
parent 7815babf19
commit c1807e0d70

View file

@ -23,11 +23,26 @@
""" Read CSV contacts file exported from hubspot."""
import csv
import argparse
CSV = "all-contacts.csv"
def parse_args():
parser = argparse.ArgumentParser(description="Parse Hubspot Contacts CSV Export")
parser.add_argument(
"-c",
"--csv",
help="Contacts CSV File",
type=str,
required=True,
)
args = parser.parse_args()
return args
def main():
args = parse_args()
CSV = args.csv
print("Parsing" + CSV)
with open(CSV, newline="") as csvfile: