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

Function download_zstd_csv_local

ocrflux/work_queue.py:122–137  ·  view source on GitHub ↗

Download a zstd-compressed CSV from a local path. If the file doesn't exist, returns an empty list.

(local_path: str)

Source from the content-addressed store, hash-verified

120
121
122def download_zstd_csv_local(local_path: str) -> List[str]:
123 """
124 Download a zstd-compressed CSV from a local path.
125 If the file doesn't exist, returns an empty list.
126 """
127 if not os.path.exists(local_path):
128 return []
129
130 if not zstandard:
131 raise RuntimeError("zstandard package is required for local zstd CSV operations.")
132
133 with open(local_path, "rb") as f:
134 dctx = zstandard.ZstdDecompressor()
135 data = dctx.decompress(f.read())
136 lines = data.decode("utf-8").splitlines()
137 return lines
138
139
140def upload_zstd_csv_local(local_path: str, lines: List[str]) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected