Skip to content

Support Loading GZIP compressed JSON files #8

@BatuhanSA

Description

@BatuhanSA

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions