This commit is contained in:
Christian Mantha
2026-03-02 19:10:52 -05:00
commit 2ca0b9ef7c
28907 changed files with 5233713 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import urllib.parse
def parse_s3_uri(uri):
"""Parse an S3 URI, returning (bucket, path)"""
parsed = urllib.parse.urlparse(uri)
if parsed.scheme != "s3":
raise Exception(f"Not an S3 URI: {uri}")
path = parsed.path
if path.startswith("/"):
path = path[1:]
return parsed.netloc, path
def is_uri(string):
parsed_uri = urllib.parse.urlparse(string)
return len(parsed_uri.scheme) > 0