CLI argument parsing
This commit is contained in:
parent
7815babf19
commit
c1807e0d70
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue