MCPcopy Create free account
hub / github.com/chatdoc-com/OCRFlux / upload_zstd_csv_local

Function upload_zstd_csv_local

ocrflux/work_queue.py:140–155  ·  view source on GitHub ↗

Upload a zstd-compressed CSV to a local path.

(local_path: str, lines: List[str])

Source from the content-addressed store, hash-verified

138
139
140def upload_zstd_csv_local(local_path: str, lines: List[str]) -> None:
141 """
142 Upload a zstd-compressed CSV to a local path.
143 """
144 if not zstandard:
145 raise RuntimeError("zstandard package is required for local zstd CSV operations.")
146
147 data = "\n".join(lines).encode("utf-8")
148 cctx = zstandard.ZstdCompressor()
149 compressed_data = cctx.compress(data)
150
151 # Ensure parent directories exist
152 os.makedirs(os.path.dirname(local_path), exist_ok=True)
153
154 with open(local_path, "wb") as f:
155 f.write(compressed_data)
156
157
158# --------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected