MCPcopy
hub / github.com/TheAlgorithms/Python / compress

Function compress

data_compression/lempel_ziv.py:113–121  ·  view source on GitHub ↗

Reads source file, compresses it and writes the compressed result in destination file

(source_path: str, destination_path: str)

Source from the content-addressed store, hash-verified

111
112
113def compress(source_path: str, destination_path: str) -> None:
114 """
115 Reads source file, compresses it and writes the compressed result in destination
116 file
117 """
118 data_bits = read_file_binary(source_path)
119 compressed = compress_data(data_bits)
120 compressed = add_file_length(source_path, compressed)
121 write_file_binary(destination_path, compressed)
122
123
124if __name__ == "__main__":

Callers 2

lempel_ziv.pyFile · 0.70
odd_sieveFunction · 0.50

Calls 4

compress_dataFunction · 0.85
add_file_lengthFunction · 0.85
read_file_binaryFunction · 0.70
write_file_binaryFunction · 0.70

Tested by

no test coverage detected