-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
It would be very useful if the JSON utilities could natively load GZIP compressed JSON (.json.gz) files. This would simplify workflows that store large JSON artifacts in compressed form and remove the need for users to manually handle decompression.
Proposed API and usage examples:
path = "some/path/file.json.gz"
with open(path, "r") as file:
edq.util.json.load(file, gzip=True)
with gzip.open(path, "rb") as file:
edq.util.json.load(file, gzip = False)
edq.util.json.load_path(path, gzip = False)
edq.util.json.load_path(path, gzip = None)
edq.util.json.load_path(path, gzip = True)
Expected behavior:
gzip = None (default): Automatically detect compression based on file extension (.gz).
gzip = True: Explicitly treat the input as GZIP compressed
gzip = False: Explicitly treat the input as plain JSON