(self, file_path, compression_level=3)
| 20 | # Modified version of lm_dataformat Archive for single file. |
| 21 | class Archive: |
| 22 | def __init__(self, file_path, compression_level=3): |
| 23 | self.file_path = file_path |
| 24 | dir_name = os.path.dirname(file_path) |
| 25 | if dir_name: |
| 26 | os.makedirs(dir_name, exist_ok=True) |
| 27 | self.fh = open(self.file_path, "wb") |
| 28 | self.cctx = zstandard.ZstdCompressor(level=compression_level) |
| 29 | self.compressor = self.cctx.stream_writer(self.fh) |
| 30 | |
| 31 | def add_data(self, data, meta={}): |
| 32 | self.compressor.write( |
nothing calls this directly
no outgoing calls
no test coverage detected