utils
This module provides utility functions for file compression.
Functions:
| Name | Description |
|---|---|
compress_and_write |
str) -> str: Compresses a file using ZIP compression and writes it to disk, then removes the original uncompressed file. |
Imports
os: Provides a way of using operating system dependent functionality like reading or writing to the file system. zipfile: Provides tools to create, read, write, append, and list a ZIP file.
compress_and_write(path_to_file)
Compress a file and write it to disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_to_file
|
str
|
Path to the file to compress. |
required |
Returns: path_to_output (str): Path to the output file.