MCPcopy
hub / github.com/Kanaries/pygwalker / compress_data

Function compress_data

pygwalker/services/render.py:22–26  ·  view source on GitHub ↗
(data: str)

Source from the content-addressed store, hash-verified

20
21
22def compress_data(data: str) -> str:
23 compress = zlib.compressobj(zlib.Z_BEST_COMPRESSION, zlib.DEFLATED, 15, 8, 0)
24 compressed_data = compress.compress(data.encode())
25 compressed_data += compress.flush()
26 return base64.b64encode(compressed_data).decode()
27
28
29with open(os.path.join(ROOT_DIR, 'templates', 'dist', 'pygwalker-app.iife.js'), 'r', encoding='utf8') as f:

Callers 5

render_gw_preview_htmlFunction · 0.90
render.pyFile · 0.85
render_gwalker_htmlFunction · 0.85
open_in_desktopMethod · 0.85

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected