From c1807e0d7033ea35470c80bc946dce4a3568a12e Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Thu, 19 Sep 2024 12:20:47 -0600 Subject: [PATCH] CLI argument parsing --- hsparse/parse_csv_contacts.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hsparse/parse_csv_contacts.py b/hsparse/parse_csv_contacts.py index c84e1ab..5a19d97 100644 --- a/hsparse/parse_csv_contacts.py +++ b/hsparse/parse_csv_contacts.py @@ -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: