MCPcopy Create free account
hub / github.com/datapane/datapane / inmemory_compress

Function inmemory_compress

python-client/src/datapane/common/ops_utils.py:86–93  ·  view source on GitHub ↗

(x-plat) Memory-based gzip compression

(content: t.BinaryIO)

Source from the content-addressed store, hash-verified

84
85
86def inmemory_compress(content: t.BinaryIO) -> t.BinaryIO:
87 """(x-plat) Memory-based gzip compression"""
88 content.seek(0)
89 zbuf = io.BytesIO()
90 with gzip.GzipFile(mode="wb", fileobj=zbuf, mtime=0.0) as zfile:
91 zfile.write(content.read())
92 zbuf.seek(0)
93 return zbuf
94
95
96@contextmanager

Callers

nothing calls this directly

Calls 2

readMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected