diff options
Diffstat (limited to 'gdpr_obfuscator/utils.py')
| -rw-r--r-- | gdpr_obfuscator/utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdpr_obfuscator/utils.py b/gdpr_obfuscator/utils.py new file mode 100644 index 0000000..77ca1cf --- /dev/null +++ b/gdpr_obfuscator/utils.py @@ -0,0 +1,16 @@ +# Utility functions +from obfuscator.logger import get_logger + + +class Utilities: + def __init__(self, logger=None): + self.logger = get_logger("UTILITIES", logger) + + def get_s3_path(self, uri): + parts = uri.replace("s3://", "").split("/") + self.logger.debug(f"Parts: {parts}") + bucket = parts.pop(0) + self.logger.debug(f"Bucket: {bucket}") + key = "/".join(parts) + self.logger.debug(f"Key: {key}") + return bucket, key |
