MCPcopy Create free account
hub / github.com/dask/dask / zip_compress

Function zip_compress

dask/bytes/utils.py:10–17  ·  view source on GitHub ↗

Write data into zipfile and return the bytes

(data)

Source from the content-addressed store, hash-verified

8
9
10def zip_compress(data):
11 """Write data into zipfile and return the bytes"""
12 out = io.BytesIO()
13 with zipfile.ZipFile(file=out, mode="w") as z:
14 with z.open("myfile", "w") as zf:
15 zf.write(data)
16 out.seek(0)
17 return out.read()
18
19
20compress = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected