diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-12 01:49:24 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-12 01:50:00 +0000 |
| commit | a5696fe5939119d091117b0d81976ac1dd708692 (patch) | |
| tree | 5ca9610652d52e7c77cbb3fb290bead4702b97b9 /main.py | |
| parent | ecadaaf8d0d0f22b3ff24fa5fd99845da262d2af (diff) | |
| download | gdpr-obfuscator-a5696fe5939119d091117b0d81976ac1dd708692.tar.gz gdpr-obfuscator-a5696fe5939119d091117b0d81976ac1dd708692.zip | |
add logging & move main.py to project root
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +import csv +from io import StringIO +from typing import List, Dict +import logging + +logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) +if not logger.handlers: + handler = logging.StreamHandler() + formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') + handler.setFormatter(formatter) + logger.addHandler(handler) + +def csv_reader(content: str) -> List[Dict[str, str]]: + f = StringIO(content) + reader = csv.DictReader(f) + logger.info("Finished reading CSV!") + return list(reader) + + |
