aboutsummaryrefslogtreecommitdiffstats
path: root/cli.py
diff options
context:
space:
mode:
authorAlex <git@ajschof.me>2025-02-17 01:19:11 +0000
committerGitHub <noreply@github.com>2025-02-17 01:19:11 +0000
commit73462d62d48cd3cf061697f9f6a390437ee29f2d (patch)
tree4331016762f96c0861b46ac67343a0769f038fa6 /cli.py
parente6bedc5c9d391b761fec6529de8537a991125c26 (diff)
parentcf1376862fb2f58c2e837338ed9c765439ffa1b9 (diff)
downloadgdpr-obfuscator-73462d62d48cd3cf061697f9f6a390437ee29f2d.tar.gz
gdpr-obfuscator-73462d62d48cd3cf061697f9f6a390437ee29f2d.zip
Merge pull request #1 from ajschofield/feat/csv-reader
merge csvreader into stable
Diffstat (limited to 'cli.py')
-rw-r--r--cli.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/cli.py b/cli.py
new file mode 100644
index 0000000..19e64d8
--- /dev/null
+++ b/cli.py
@@ -0,0 +1,26 @@
+import argparse
+from obfuscator.csv_reader import CSVReader
+from obfuscator.logger import get_logger
+
+logger = get_logger("CLI")
+
+
+def main():
+ parser = argparse.ArgumentParser(description="gdpr-obfuscator")
+ # Require user to either choose a local file or an S3 object
+ loc = parser.add_mutually_exclusive_group(required=True)
+ loc.add_argument("--local")
+ loc.add_argument("--s3")
+ args = parser.parse_args()
+
+ if args.local and not args.s3:
+ logger.debug("User chose to read CSV from local path")
+ reader = CSVReader()
+ data = reader.read_local(args.local)
+ print(data)
+ else:
+ logger.debug("User chose to read CSV from S3")
+
+
+if __name__ == "__main__":
+ main()
git.ajschof.me — hosted by ajschofield — powered by cgit