Compress a file.
path (str or Path) – File to compress.
method (str) – One of 'gz', 'bz2', 'xz', 'zip'.
'gz'
'bz2'
'xz'
'zip'
remove (bool) – Delete the original file after compression (default True).
True
Path to the compressed file.
str