aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2021-01-25 11:14:50 +0000
committerMatthew Lemon <matt@matthewlemon.com>2021-01-25 11:14:50 +0000
commitb9d3472df20d145b0717ab8f578033d8c4cf5d16 (patch)
tree968171dd446a944d63cbcfcd4c83891afec7c327
parent80f862240093f21afba6f5b03102b07ae33cfdd5 (diff)
added flag for -z --zipinput
-rw-r--r--datamaps/main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/datamaps/main.py b/datamaps/main.py
index 444b56f..4efbfe7 100644
--- a/datamaps/main.py
+++ b/datamaps/main.py
@@ -148,6 +148,7 @@ def show_file():
@click.option(
"--datamap", "-d", help="Path to datamap file", type=Path, metavar="CSV_FILE_PATH"
)
+@click.option("--zipinput", "-z", help="Path to zip containing templates", type=Path, metavar="ZIP_PATH")
@click.option(
"--rowlimit",
type=int,
@@ -170,7 +171,7 @@ def show_file():
" option"
),
)
-def templates(to_master, datamap, rowlimit, inputdir, validationonly):
+def templates(to_master, datamap, zipinput, rowlimit, inputdir, validationonly):
"""Import data to a from populated templates.
Import data from the template files stored in the input directory to create
@@ -208,6 +209,9 @@ def templates(to_master, datamap, rowlimit, inputdir, validationonly):
if datamap:
if not datamap.is_absolute():
datamap = Path.cwd() / datamap
+ if zipinput:
+ if not zipinput.is_absolute():
+ zipinput = Path.cwd() / zipinput
if inputdir:
if not inputdir.is_absolute():
inputdir = Path.cwd() / inputdir
@@ -224,6 +228,7 @@ def templates(to_master, datamap, rowlimit, inputdir, validationonly):
engine_cli.import_and_create_master(
echo_funcs=output_funcs,
datamap=datamap,
+ zipinput=zipinput,
rowlimit=rowlimit,
inputdir=inputdir,
validationonly=validationonly,
@@ -266,6 +271,7 @@ def templates(to_master, datamap, rowlimit, inputdir, validationonly):
engine_cli.import_and_create_master(
echo_funcs=output_funcs,
datamap=datamap,
+ zipinput=zipinput,
rowlimit=rowlimit,
inputdir=inputdir,
)