acidbase.compress

acidbase.compress(path: str | Path, method: str = 'gz', *, remove: bool = True) str

Compress a file.

Parameters:
  • path (str or Path) – File to compress.

  • method (str) – One of 'gz', 'bz2', 'xz', 'zip'.

  • remove (bool) – Delete the original file after compression (default True).

Returns:

Path to the compressed file.

Return type:

str